From c5b61d2f46ac19bf511197f3a537c4be0f47df33 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 27 Aug 2021 20:59:34 -0400 Subject: Updates to the Ruby compiler. --- stdlib/source/poly/lux/abstract/equivalence.lux | 2 +- stdlib/source/poly/lux/abstract/functor.lux | 5 +++-- stdlib/source/poly/lux/data/format/json.lux | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) (limited to 'stdlib/source/poly') diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux index a75f56f2d..fddbc16ff 100644 --- a/stdlib/source/poly/lux/abstract/equivalence.lux +++ b/stdlib/source/poly/lux/abstract/equivalence.lux @@ -155,7 +155,7 @@ ... Polymorphism (do ! [[funcC varsC bodyC] (.polymorphic equivalence)] - (in (` (: (All [(~+ varsC)] + (in (` (: (All ((~ g!_) (~+ varsC)) (-> (~+ (list\each (|>> (~) ((~! /.Equivalence)) (`)) varsC)) ((~! /.Equivalence) ((~ (poly.code *env* inputT)) (~+ varsC))))) (function ((~ funcC) (~+ varsC)) diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux index e607f1174..44a3bdaef 100644 --- a/stdlib/source/poly/lux/abstract/functor.lux +++ b/stdlib/source/poly/lux/abstract/functor.lux @@ -26,7 +26,8 @@ (poly: .public functor (do {! p.monad} - [.let [type_funcC (code.local_identifier "____________type_funcC") + [.let [g!_ (code.local_identifier "____________") + type_funcC (code.local_identifier "____________type_funcC") funcC (code.local_identifier "____________funcC") inputC (code.local_identifier "____________inputC")] *env* .env @@ -39,7 +40,7 @@ (if (n.= 1 num_vars) (` ((~! /.Functor) (~ (poly.code *env* unwrappedT)))) (let [paramsC (|> num_vars -- list.indices (list\each (|>> %.nat code.local_identifier)))] - (` (All [(~+ paramsC)] + (` (All ((~ g!_) (~+ paramsC)) ((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC))))))))) Arg (: (-> Code (.Parser Code)) (function (Arg valueC) diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux index d538a7e92..512ca920c 100644 --- a/stdlib/source/poly/lux/data/format/json.lux +++ b/stdlib/source/poly/lux/data/format/json.lux @@ -45,9 +45,9 @@ (|>> .int int.frac)) (def: (rec_encoded non_rec) - (All [a] (-> (-> (-> a JSON) - (-> a JSON)) - (-> a JSON))) + (All (_ a) (-> (-> (-> a JSON) + (-> a JSON)) + (-> a JSON))) (function (_ input) (non_rec (rec_encoded non_rec) input))) @@ -80,14 +80,14 @@ (def: (nullable writer) {#.doc "Builds a JSON generator for potentially inexistent values."} - (All [a] (-> (-> a JSON) (-> (Maybe a) JSON))) + (All (_ a) (-> (-> a JSON) (-> (Maybe a) JSON))) (function (_ elem) (case elem #.None #/.Null (#.Some value) (writer value)))) (implementation: qty_codec - (All [unit] + (All (_ unit) (codec.Codec JSON (unit.Qty unit))) (def: encoded @@ -125,7 +125,8 @@ [month.Month month.codec])] (do {! <>.monad} [*env* .env - .let [@JSON\encoded (: (-> Type Code) + .let [g!_ (code.local_identifier "_______") + @JSON\encoded (: (-> Type Code) (function (_ type) (` (-> (~ (poly.code *env* type)) /.JSON))))] inputT .next] @@ -208,7 +209,7 @@ ... Polymorphism (do ! [[funcC varsC bodyC] (.polymorphic encoded)] - (in (` (: (All [(~+ varsC)] + (in (` (: (All ((~ g!_) (~+ varsC)) (-> (~+ (list\each (function (_ varC) (` (-> (~ varC) /.JSON))) varsC)) (-> ((~ (poly.code *env* inputT)) (~+ varsC)) @@ -248,7 +249,8 @@ [month.Month month.codec])] (do {! <>.monad} [*env* .env - .let [@JSON\decoded (: (-> Type Code) + .let [g!_ (code.local_identifier "_______") + @JSON\decoded (: (-> Type Code) (function (_ type) (` (.Parser (~ (poly.code *env* type))))))] inputT .next] @@ -312,7 +314,7 @@ ... Polymorphism (do ! [[funcC varsC bodyC] (.polymorphic decoded)] - (in (` (: (All [(~+ varsC)] + (in (` (: (All ((~ g!_) (~+ varsC)) (-> (~+ (list\each (|>> (~) .Parser (`)) varsC)) (.Parser ((~ (poly.code *env* inputT)) (~+ varsC))))) (function ((~ funcC) (~+ varsC)) -- cgit v1.2.3