diff options
Diffstat (limited to 'stdlib/source/poly')
-rw-r--r-- | stdlib/source/poly/lux/abstract/equivalence.lux | 20 | ||||
-rw-r--r-- | stdlib/source/poly/lux/abstract/functor.lux | 12 | ||||
-rw-r--r-- | stdlib/source/poly/lux/data/format/json.lux | 28 |
3 files changed, 30 insertions, 30 deletions
diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux index 4c33de0f3..797caaf12 100644 --- a/stdlib/source/poly/lux/abstract/equivalence.lux +++ b/stdlib/source/poly/lux/abstract/equivalence.lux @@ -50,7 +50,7 @@ (function (_ type) (` ((~! /.Equivalence) (~ (poly.code *env* type))))))]] ($_ <>.either - ## Basic types + ... Basic types (~~ (template [<matcher> <eq>] [(do ! [_ <matcher>] @@ -64,7 +64,7 @@ [(<type>.sub Rev) (~! rev.equivalence)] [(<type>.sub Frac) (~! frac.equivalence)] [(<type>.sub Text) (~! text.equivalence)])) - ## Composite types + ... Composite types (~~ (template [<name> <eq>] [(do ! [[_ argC] (<type>.applied (<>.and (<type>.exactly <name>) @@ -87,7 +87,7 @@ equivalence))] (in (` (: (~ (@Equivalence inputT)) ((~! dictionary.equivalence) (~ valC)))))) - ## Models + ... Models (~~ (template [<type> <eq>] [(do ! [_ (<type>.exactly <type>)] @@ -105,7 +105,7 @@ <type>.any))] (in (` (: (~ (@Equivalence inputT)) unit.equivalence)))) - ## Variants + ... Variants (do ! [members (<type>.variant (<>.many equivalence)) .let [last (dec (list.size members)) @@ -126,7 +126,7 @@ (list.enumeration members)))) (~ g!_) #0)))))) - ## Tuples + ... Tuples (do ! [g!eqs (<type>.tuple (<>.many equivalence)) .let [g!_ (code.local_identifier "_____________") @@ -138,7 +138,7 @@ (and (~+ (|> (list.zipped/3 g!eqs g!lefts g!rights) (list\map (function (_ [g!eq g!left g!right]) (` ((~ g!eq) (~ g!left) (~ g!right))))))))))))) - ## Type recursion + ... Type recursion (do ! [[g!self bodyC] (<type>.recursive equivalence) .let [g!_ (code.local_identifier "_____________")]] @@ -146,13 +146,13 @@ ((~! /.rec) (.function ((~ g!_) (~ g!self)) (~ bodyC))))))) <type>.recursive_self - ## Type applications + ... Type applications (do ! [[funcC argsC] (<type>.applied (<>.and equivalence (<>.many equivalence)))] (in (` ((~ funcC) (~+ argsC))))) - ## Parameters + ... Parameters <type>.parameter - ## Polymorphism + ... Polymorphism (do ! [[funcC varsC bodyC] (<type>.polymorphic equivalence)] (in (` (: (All [(~+ varsC)] @@ -161,7 +161,7 @@ (function ((~ funcC) (~+ varsC)) (~ bodyC)))))) <type>.recursive_call - ## If all else fails... + ... If all else fails... (|> <type>.any (\ ! map (|>> %.type (format "Cannot create Equivalence for: ") <>.failure)) (\ ! join)) diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux index bb9ef4a88..842c4b66c 100644 --- a/stdlib/source/poly/lux/abstract/functor.lux +++ b/stdlib/source/poly/lux/abstract/functor.lux @@ -44,12 +44,12 @@ Arg<?> (: (-> Code (<type>.Parser Code)) (function (Arg<?> valueC) ($_ p.either - ## Type-var + ... Type-var (do p.monad [.let [varI (|> num_vars (n.* 2) dec)] _ (<type>.parameter! varI)] (in (` ((~ funcC) (~ valueC))))) - ## Variants + ... Variants (do ! [_ (in []) membersC (<type>.variant (p.many (Arg<?> valueC))) @@ -62,7 +62,7 @@ (list (` ((~ (code.nat tag)) #0 (~ valueC))) (` ((~ (code.nat tag)) #0 (~ memberC)))))) (list.enumeration membersC)))))))) - ## Tuples + ... Tuples (do p.monad [pairsCC (: (<type>.Parser (List [Code Code])) (<type>.tuple (loop [idx 0 @@ -78,7 +78,7 @@ (in (` (case (~ valueC) [(~+ (list\map product.left pairsCC))] [(~+ (list\map product.right pairsCC))])))) - ## Functions + ... Functions (do ! [_ (in []) .let [g! (code.local_identifier "____________") @@ -91,11 +91,11 @@ (in (` (function ((~ g!) (~+ inC+)) (let [(~ outL) ((~ valueC) (~+ inC+))] (~ outC)))))) - ## Recursion + ... Recursion (do p.monad [_ <type>.recursive_call] (in (` ((~' map) (~ funcC) (~ valueC))))) - ## Parameters + ... Parameters (do p.monad [_ <type>.any] (in valueC)) diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux index 847e3a160..5ee07e1d1 100644 --- a/stdlib/source/poly/lux/data/format/json.lux +++ b/stdlib/source/poly/lux/data/format/json.lux @@ -29,8 +29,8 @@ ["." int] ["." frac]]] [time - ## ["." instant] - ## ["." duration] + ... ["." instant] + ... ["." duration] ["." date] ["." day] ["." month]] @@ -116,8 +116,8 @@ (in (` (: (~ (@JSON\encode inputT)) (|>> (\ (~! <codec>) (~' encode)) #/.String)))))] - ## [duration.Duration duration.codec] - ## [instant.Instant instant.codec] + ... [duration.Duration duration.codec] + ... [instant.Instant instant.codec] [date.Date date.codec] [day.Day day.codec] [month.Month month.codec])] @@ -191,7 +191,7 @@ ((~! /.json) [(~+ (list\map (function (_ [g!member g!encode]) (` ((~ g!encode) (~ g!member)))) (list.zipped/2 g!members g!encoders)))])))))) - ## Type recursion + ... Type recursion (do ! [[selfC non_recC] (<type>.recursive encode) .let [g! (code.local_identifier "____________")]] @@ -199,11 +199,11 @@ ((~! ..rec_encode) (.function ((~ g!) (~ selfC)) (~ non_recC))))))) <type>.recursive_self - ## Type applications + ... Type applications (do ! [partsC (<type>.applied (<>.many encode))] (in (` ((~+ partsC))))) - ## Polymorphism + ... Polymorphism (do ! [[funcC varsC bodyC] (<type>.polymorphic encode)] (in (` (: (All [(~+ varsC)] @@ -215,7 +215,7 @@ (~ bodyC)))))) <type>.parameter <type>.recursive_call - ## If all else fails... + ... If all else fails... (<>.failure (format "Cannot create JSON encoder for: " (type.format inputT))) )))) @@ -239,8 +239,8 @@ (in (` (: (~ (@JSON\decode inputT)) ((~! <>.codec) (~! <codec>) (~! </>.string))))))] - ## [duration.Duration duration.codec] - ## [instant.Instant instant.codec] + ... [duration.Duration duration.codec] + ... [instant.Instant instant.codec] [date.Date date.codec] [day.Day day.codec] [month.Month month.codec])] @@ -295,7 +295,7 @@ [g!decoders (<type>.tuple (<>.many decode))] (in (` (: (~ (@JSON\decode inputT)) ((~! </>.array) ($_ ((~! <>.and)) (~+ g!decoders))))))) - ## Type recursion + ... Type recursion (do ! [[selfC bodyC] (<type>.recursive decode) .let [g! (code.local_identifier "____________")]] @@ -303,11 +303,11 @@ ((~! <>.rec) (.function ((~ g!) (~ selfC)) (~ bodyC))))))) <type>.recursive_self - ## Type applications + ... Type applications (do ! [[funcC argsC] (<type>.applied (<>.and decode (<>.many decode)))] (in (` ((~ funcC) (~+ argsC))))) - ## Polymorphism + ... Polymorphism (do ! [[funcC varsC bodyC] (<type>.polymorphic decode)] (in (` (: (All [(~+ varsC)] @@ -317,7 +317,7 @@ (~ bodyC)))))) <type>.parameter <type>.recursive_call - ## If all else fails... + ... If all else fails... (<>.failure (format "Cannot create JSON decoder for: " (type.format inputT))) )))) |