diff options
Diffstat (limited to 'stdlib/source/lux/data/format/json.lux')
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 7d2e90270..edafe3178 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -296,7 +296,7 @@ [string Text #String "string"] ) -(do-template [<test> <check> <type> <eq> <encoder> <tag> <desc> <pre>] +(do-template [<test> <check> <type> <eq> <encoder> <tag> <desc>] [(def: #export (<test> test) {#.doc (code.text ($_ text/compose "Asks whether a JSON value is a " <desc> "."))} (-> <type> (Reader Bit)) @@ -304,7 +304,7 @@ [head any] (case head (<tag> value) - (wrap (:: <eq> = test (<pre> value))) + (wrap (:: <eq> = test value)) _ (fail ($_ text/compose "JSON value is not " <desc> "."))))) @@ -316,17 +316,16 @@ [head any] (case head (<tag> value) - (let [value (<pre> value)] - (if (:: <eq> = test value) - (wrap []) - (fail ($_ text/compose "Value mismatch: " (<encoder> test) " =/= " (<encoder> value))))) + (if (:: <eq> = test value) + (wrap []) + (fail ($_ text/compose "Value mismatch: " (<encoder> test) " =/= " (<encoder> value)))) _ (fail ($_ text/compose "JSON value is not a " <desc> ".")))))] - [boolean? boolean! Bit bit.Equivalence<Bit> encode-boolean #Boolean "boolean" id] - [number? number! Frac number.Equivalence<Frac> (:: number.Codec<Text,Frac> encode) #Number "number" id] - [string? string! Text text.Equivalence<Text> text.encode #String "string" id] + [boolean? boolean! Bit bit.Equivalence<Bit> encode-boolean #Boolean "boolean"] + [number? number! Frac number.Equivalence<Frac> (:: number.Codec<Text,Frac> encode) #Number "number"] + [string? string! Text text.Equivalence<Text> text.encode #String "string"] ) (def: #export (nullable parser) |