From a62ce3f9c2b605e0033f4772b0f64c4525de4d86 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 11 Aug 2021 02:38:59 -0400 Subject: Relocated maybe and lazy from data to control. --- stdlib/source/poly/lux/abstract/equivalence.lux | 2 +- stdlib/source/poly/lux/data/format/json.lux | 45 +++++++++++++------------ 2 files changed, 24 insertions(+), 23 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 797caaf12..895c8d1a5 100644 --- a/stdlib/source/poly/lux/abstract/equivalence.lux +++ b/stdlib/source/poly/lux/abstract/equivalence.lux @@ -4,12 +4,12 @@ [abstract [monad (#+ Monad do)]] [control + ["." maybe] ["<>" parser ["<.>" type]]] [data ["." product] ["." bit] - ["." maybe] ["." text ("#\." monoid) ["%" format (#+ format)]] [collection diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux index 5ee07e1d1..5b48aa34b 100644 --- a/stdlib/source/poly/lux/data/format/json.lux +++ b/stdlib/source/poly/lux/data/format/json.lux @@ -62,12 +62,12 @@ (#/.Array (row (|> high .int int.frac #/.Number) (|> low .int int.frac #/.Number))))) (def: decode - (.run (.array - (do <>.monad - [high .number - low .number] - (in (n.+ (|> high frac.int .nat (i64.left_shifted 32)) - (|> low frac.int .nat)))))))) + (.result (.array + (do <>.monad + [high .number + low .number] + (in (n.+ (|> high frac.int .nat (i64.left_shifted 32)) + (|> low frac.int .nat)))))))) (implementation: int_codec (codec.Codec JSON Int) @@ -322,27 +322,28 @@ )))) (syntax: .public (codec inputT) - {#.doc (doc "A macro for automatically producing JSON codecs." - (type: Variant - (#Bit Bit) - (#Text Text) - (#Frac Frac)) + {#.doc (example "A macro for automatically producing JSON codecs." + (type: Variant + (#Bit Bit) + (#Text Text) + (#Frac Frac)) - (type: Record - {#bit Bit - #frac Frac - #text Text - #maybe (Maybe Frac) - #list (List Frac) - #variant Variant - #tuple [Bit Frac Text] - #dictionary (Dictionary Text Frac)}) + (type: Record + {#bit Bit + #frac Frac + #text Text + #maybe (Maybe Frac) + #list (List Frac) + #variant Variant + #tuple [Bit Frac Text] + #dictionary (Dictionary Text Frac)}) - (derived: (..codec Record)))} + (derived: codec + (..codec Record)))} (in (.list (` (: (codec.Codec /.JSON (~ inputT)) (implementation (def: (~' encode) ((~! ..encode) (~ inputT))) (def: (~' decode) - ((~! .run) ((~! ..decode) (~ inputT)))) + ((~! .result) ((~! ..decode) (~ inputT)))) )))))) -- cgit v1.2.3