aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/json.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-03-14 18:27:37 -0400
committerEduardo Julian2022-03-14 18:27:37 -0400
commit41495e32d3f5f88b5f189f48dd4fdbfa883c6ac0 (patch)
tree7a561e83768d5ac4eb08855858dde38d2987fc46 /stdlib/source/library/lux/data/format/json.lux
parent62299ecdc93b39f6a22b1f89779f55dfa735fb3c (diff)
De-sigil-ification: >
Diffstat (limited to 'stdlib/source/library/lux/data/format/json.lux')
-rw-r--r--stdlib/source/library/lux/data/format/json.lux87
1 files changed, 44 insertions, 43 deletions
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux
index 315665921..aee3310cd 100644
--- a/stdlib/source/library/lux/data/format/json.lux
+++ b/stdlib/source/library/lux/data/format/json.lux
@@ -1,34 +1,34 @@
(.using
- [library
- [lux {"-" has}
- ["[0]" meta {"+" monad}]
- [abstract
- [equivalence {"+" Equivalence}]
- [codec {"+" Codec}]
- [predicate {"+" Predicate}]
- ["[0]" monad {"+" do}]]
- [control
- pipe
- ["[0]" maybe]
- ["[0]" try {"+" Try}]
- ["<>" parser ("[1]#[0]" monad)
- ["<[0]>" text {"+" Parser}]
- ["<[0]>" code]]]
- [data
- ["[0]" bit]
- ["[0]" product]
- ["[0]" text ("[1]#[0]" equivalence monoid)]
- [collection
- ["[0]" list ("[1]#[0]" mix functor)]
- ["[0]" sequence {"+" Sequence sequence} ("[1]#[0]" monad)]
- ["[0]" dictionary {"+" Dictionary}]]]
- [macro
- [syntax {"+" syntax:}]
- ["[0]" code]]
- [math
- [number
- ["n" nat]
- ["f" frac ("[1]#[0]" decimal)]]]]])
+ [library
+ [lux {"-" has}
+ ["[0]" meta {"+" monad}]
+ [abstract
+ [equivalence {"+" Equivalence}]
+ [codec {"+" Codec}]
+ [predicate {"+" Predicate}]
+ ["[0]" monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" maybe]
+ ["[0]" try {"+" Try}]
+ ["<>" parser ("[1]#[0]" monad)
+ ["<[0]>" text {"+" Parser}]
+ ["<[0]>" code]]]
+ [data
+ ["[0]" bit]
+ ["[0]" product]
+ ["[0]" text ("[1]#[0]" equivalence monoid)]
+ [collection
+ ["[0]" list ("[1]#[0]" mix functor)]
+ ["[0]" sequence {"+" Sequence sequence} ("[1]#[0]" monad)]
+ ["[0]" dictionary {"+" Dictionary}]]]
+ [macro
+ [syntax {"+" syntax:}]
+ ["[0]" code]]
+ [math
+ [number
+ ["n" nat]
+ ["f" frac ("[1]#[0]" decimal)]]]]])
(template [<name> <type>]
[(type: .public <name>
@@ -60,8 +60,8 @@
(def: .public null?
(Predicate JSON)
- (|>> (case> {#Null} true
- _ false)))
+ (|>> (pipe.case {#Null} true
+ _ false)))
(def: .public object
(-> (List [String JSON]) JSON)
@@ -226,20 +226,21 @@
(def: boolean_format
(-> Boolean Text)
- (|>> (case>
- #0 "false"
- #1 "true")))
+ (|>> (pipe.case
+ #0 "false"
+ #1 "true")))
(def: number_format
(-> Number Text)
- (|>> (case> +0.0 ... OR -0.0
- "0.0"
-
- value
- (let [raw (# f.decimal encoded value)]
- (if (f.< +0.0 value)
- raw
- (|> raw (text.split_at 1) maybe.trusted product.right))))))
+ (|>> (pipe.case
+ +0.0 ... OR -0.0
+ "0.0"
+
+ value
+ (let [raw (# f.decimal encoded value)]
+ (if (f.< +0.0 value)
+ raw
+ (|> raw (text.split_at 1) maybe.trusted product.right))))))
(def: escape "\")
(def: escaped_dq (text#composite ..escape text.double_quote))