aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/poly/lux/data/format/json.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/poly/lux/data/format/json.lux')
-rw-r--r--stdlib/source/poly/lux/data/format/json.lux45
1 files changed, 23 insertions, 22 deletions
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))))
))))))