diff options
author | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-23 02:30:53 -0400 |
commit | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (patch) | |
tree | c730b4ca89af366779b0ad0f46fae705b5c2bcbc /stdlib/source/library/lux/data/format/json.lux | |
parent | 1ea83ecadccc5adee1bdb35bd11527c3982c015e (diff) |
The Python compiler can now be compiled by the new JVM compiler.
Diffstat (limited to 'stdlib/source/library/lux/data/format/json.lux')
-rw-r--r-- | stdlib/source/library/lux/data/format/json.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index ed2643efa..bcfd44f80 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -19,7 +19,7 @@ ["." product] ["." text ("#\." equivalence monoid)] [collection - ["." list ("#\." fold functor)] + ["." list ("#\." mix functor)] ["." row (#+ Row row) ("#\." monad)] ["." dictionary (#+ Dictionary)]]] [macro @@ -169,25 +169,25 @@ [(#Array xs) (#Array ys)] (and (n.= (row.size xs) (row.size ys)) - (list\fold (function (_ idx prev) - (and prev - (maybe.else #0 - (do maybe.monad - [x' (row.item idx xs) - y' (row.item idx ys)] - (in (= x' y')))))) - #1 - (list.indices (row.size xs)))) + (list\mix (function (_ idx prev) + (and prev + (maybe.else #0 + (do maybe.monad + [x' (row.item idx xs) + y' (row.item idx ys)] + (in (= x' y')))))) + #1 + (list.indices (row.size xs)))) [(#Object xs) (#Object ys)] (and (n.= (dictionary.size xs) (dictionary.size ys)) - (list\fold (function (_ [xk xv] prev) - (and prev - (case (dictionary.value xk ys) - #.None #0 - (#.Some yv) (= xv yv)))) - #1 - (dictionary.entries xs))) + (list\mix (function (_ [xk xv] prev) + (and prev + (case (dictionary.value xk ys) + #.None #0 + (#.Some yv) (= xv yv)))) + #1 + (dictionary.entries xs))) _ #0))) @@ -210,7 +210,7 @@ (-> Number Text) (|>> (case> (^or +0.0 -0.0) "0.0" - value (let [raw (\ f.decimal encode value)] + value (let [raw (\ f.decimal encoded value)] (if (f.< +0.0 value) raw (|> raw (text.split_at 1) maybe.trusted product.right)))))) @@ -327,7 +327,7 @@ signed?' (<>.parses? (<text>.this "-")) offset (<text>.many <text>.decimal)] (in ($_ text\compose mark (if signed?' "-" "") offset))))] - (case (f\decode ($_ text\compose (if signed? "-" "") digits "." decimals exp)) + (case (f\decoded ($_ text\compose (if signed? "-" "") digits "." decimals exp)) (#try.Failure message) (<>.failure message) @@ -406,5 +406,5 @@ (implementation: .public codec (Codec Text JSON) - (def: encode ..format) - (def: decode (<text>.result json_parser))) + (def: encoded ..format) + (def: decoded (<text>.result json_parser))) |