aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/format/json.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-16 19:55:24 -0400
committerEduardo Julian2017-10-16 19:55:24 -0400
commit25609806f670b4e6a5ef0b132929c1f4f96ed100 (patch)
tree50b107d94a9c2109e4589646fa7c8cf2372863d2 /stdlib/source/lux/data/format/json.lux
parentf54e6e22e5044a0cdf28e5ee01e90e1866b29dfc (diff)
- Re-named "Vector" to "Sequence" to avoid confusion with mathematical vectors.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/format/json.lux22
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux
index 7eac167e1..e00783c0b 100644
--- a/stdlib/source/lux/data/format/json.lux
+++ b/stdlib/source/lux/data/format/json.lux
@@ -15,7 +15,7 @@
[sum]
[product]
(coll [list "list/" Fold<List> Monad<List>]
- [vector #+ Vector vector "vector/" Monad<Vector>]
+ [sequence #+ Sequence sequence "sequence/" Monad<Sequence>]
[dict #+ Dict]))
[macro #+ Monad<Lux> with-gensyms]
(macro ["s" syntax #+ syntax:]
@@ -38,13 +38,13 @@
(#Boolean Boolean)
(#Number Number)
(#String String)
- (#Array (Vector JSON))
+ (#Array (Sequence JSON))
(#Object (Dict String JSON)))
(do-template [<name> <type>]
[(type: #export <name> <type>)]
- [Array (Vector JSON)]
+ [Array (Sequence JSON)]
[Object (Dict String JSON)]
)
@@ -75,7 +75,7 @@
(wrap (list (` (: JSON #Null))))
[_ (#;Tuple members)]
- (wrap (list (` (: JSON (#Array (vector (~@ (list/map wrapper members))))))))
+ (wrap (list (` (: JSON (#Array (sequence (~@ (list/map wrapper members))))))))
[_ (#;Record pairs)]
(do Monad<Lux>
@@ -164,16 +164,16 @@
[#String text;Eq<Text>])
[(#Array xs) (#Array ys)]
- (and (n.= (vector;size xs) (vector;size ys))
+ (and (n.= (sequence;size xs) (sequence;size ys))
(list/fold (function [idx prev]
(and prev
(maybe;default false
(do maybe;Monad<Maybe>
- [x' (vector;nth idx xs)
- y' (vector;nth idx ys)]
+ [x' (sequence;nth idx xs)
+ y' (sequence;nth idx ys)]
(wrap (= x' y'))))))
true
- (list;indices (vector;size xs))))
+ (list;indices (sequence;size xs))))
[(#Object xs) (#Object ys)]
(and (n.= (dict;size xs) (dict;size ys))
@@ -288,7 +288,7 @@
[head any]
(case head
(#Array values)
- (case (p;run (vector;to-list values) parser)
+ (case (p;run (sequence;to-list values) parser)
(#E;Error error)
(fail error)
@@ -367,7 +367,7 @@
(def: (show-array show-json elems)
(-> (-> JSON Text) (-> Array Text))
($_ text/compose "["
- (|> elems (vector/map show-json) vector;to-list (text;join-with ","))
+ (|> elems (sequence/map show-json) sequence;to-list (text;join-with ","))
"]"))
(def: (show-object show-json object)
@@ -490,7 +490,7 @@
_ (l;this <close>)]
(wrap (<prep> elems))))]
- [array~ Array "[" "]" (json~ []) vector;from-list]
+ [array~ Array "[" "]" (json~ []) sequence;from-list]
[object~ Object "{" "}" (kv~ json~) (dict;from-list text;Hash<Text>)]
)