aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2018-05-01 21:51:02 -0400
committerEduardo Julian2018-05-01 21:51:02 -0400
commit00c5bad77dda7e204642976e67da536f82f0cbcf (patch)
treec8f5c39e161c32a9abc57e3552daf288852a89fb /stdlib
parent677ae72669dabcad59262287aa4d84c5631bbddd (diff)
- Re-organized dict modules.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/coll/dict/ordered.lux (renamed from stdlib/source/lux/data/coll/ordered/dict.lux)0
-rw-r--r--stdlib/source/lux/data/coll/dict/unordered.lux (renamed from stdlib/source/lux/data/coll/dict.lux)0
-rw-r--r--stdlib/source/lux/data/coll/set/ordered.lux2
-rw-r--r--stdlib/source/lux/data/coll/set/unordered.lux12
-rw-r--r--stdlib/source/lux/data/format/context.lux6
-rw-r--r--stdlib/source/lux/data/format/json.lux2
-rw-r--r--stdlib/source/lux/data/format/xml.lux12
-rw-r--r--stdlib/source/lux/lang/syntax.lux4
-rw-r--r--stdlib/source/lux/macro/poly.lux2
-rw-r--r--stdlib/source/lux/macro/poly/eq.lux2
-rw-r--r--stdlib/source/lux/macro/poly/json.lux2
-rw-r--r--stdlib/source/lux/math/random.lux2
-rw-r--r--stdlib/source/lux/type/implicit.lux4
-rw-r--r--stdlib/source/lux/type/resource.lux2
-rw-r--r--stdlib/source/lux/world/env.jvm.lux2
-rw-r--r--stdlib/test/test/lux/data/coll/dict/ordered.lux (renamed from stdlib/test/test/lux/data/coll/ordered/dict.lux)6
-rw-r--r--stdlib/test/test/lux/data/coll/dict/unordered.lux (renamed from stdlib/test/test/lux/data/coll/dict.lux)2
-rw-r--r--stdlib/test/test/lux/data/format/json.lux2
-rw-r--r--stdlib/test/test/lux/data/format/xml.lux6
-rw-r--r--stdlib/test/test/lux/lang/syntax.lux2
-rw-r--r--stdlib/test/test/lux/math/random.lux2
-rw-r--r--stdlib/test/tests.lux6
22 files changed, 40 insertions, 40 deletions
diff --git a/stdlib/source/lux/data/coll/ordered/dict.lux b/stdlib/source/lux/data/coll/dict/ordered.lux
index a099087f3..a099087f3 100644
--- a/stdlib/source/lux/data/coll/ordered/dict.lux
+++ b/stdlib/source/lux/data/coll/dict/ordered.lux
diff --git a/stdlib/source/lux/data/coll/dict.lux b/stdlib/source/lux/data/coll/dict/unordered.lux
index 97a119755..97a119755 100644
--- a/stdlib/source/lux/data/coll/dict.lux
+++ b/stdlib/source/lux/data/coll/dict/unordered.lux
diff --git a/stdlib/source/lux/data/coll/set/ordered.lux b/stdlib/source/lux/data/coll/set/ordered.lux
index 5d6ba5478..9ae151762 100644
--- a/stdlib/source/lux/data/coll/set/ordered.lux
+++ b/stdlib/source/lux/data/coll/set/ordered.lux
@@ -4,7 +4,7 @@
eq
[order #+ Order])
(data (coll [list "L/" Monad<List> Monoid<List> Fold<List>]
- (ordered ["d" dict]))
+ (dict ["d" ordered]))
["p" product]
["M" maybe #+ Functor<Maybe>])
[macro]
diff --git a/stdlib/source/lux/data/coll/set/unordered.lux b/stdlib/source/lux/data/coll/set/unordered.lux
index a09300a7a..797ac7849 100644
--- a/stdlib/source/lux/data/coll/set/unordered.lux
+++ b/stdlib/source/lux/data/coll/set/unordered.lux
@@ -2,12 +2,12 @@
lux
(lux (control [eq #+ Eq]
[hash #*])
- (data (coll [dict]
- [list "List/" Fold<List> Functor<List>]))))
+ (data (coll (dict ["dict" unordered #+ Dict])
+ [list "list/" Fold<List> Functor<List>]))))
## [Types]
(type: #export (Set a)
- (dict.Dict a a))
+ (Dict a a))
## [Values]
(def: #export (new Hash<a>)
@@ -32,7 +32,7 @@
(def: #export (from-list Hash<a> xs)
(All [a] (-> (Hash a) (List a) (Set a)))
- (List/fold add (new Hash<a>) xs))
+ (list/fold add (new Hash<a>) xs))
(def: #export (union xs yx)
(All [a] (-> (Set a) (Set a) (Set a)))
@@ -40,7 +40,7 @@
(def: #export (difference sub base)
(All [a] (-> (Set a) (Set a) (Set a)))
- (List/fold remove base (to-list sub)))
+ (list/fold remove base (to-list sub)))
(def: #export (intersection filter base)
(All [a] (-> (Set a) (Set a) (Set a)))
@@ -71,6 +71,6 @@
(def: eq Eq<Set>)
(def: (hash (^@ set [Hash<a> _]))
- (List/fold (function (_ elem acc) (n/+ (:: Hash<a> hash elem) acc))
+ (list/fold (function (_ elem acc) (n/+ (:: Hash<a> hash elem) acc))
+0
(to-list set))))
diff --git a/stdlib/source/lux/data/format/context.lux b/stdlib/source/lux/data/format/context.lux
index 9f58e9ede..c6ffbed82 100644
--- a/stdlib/source/lux/data/format/context.lux
+++ b/stdlib/source/lux/data/format/context.lux
@@ -4,13 +4,13 @@
["ex" exception #+ exception:]
[monad #+ do])
(data ["E" error]
- (coll ["d" dict]))))
+ (coll (dict ["dict" unordered #+ Dict])))))
(exception: #export (Unknown-Property {property Text})
property)
(type: #export Context
- (d.Dict Text Text))
+ (Dict Text Text))
(type: #export (Property a)
(p.Parser Context a))
@@ -18,7 +18,7 @@
(def: #export (property name)
(-> Text (Property Text))
(function (_ context)
- (case (d.get name context)
+ (case (dict.get name context)
(#.Some value)
(ex.return [context value])
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux
index 86faa0509..8ce54e9f2 100644
--- a/stdlib/source/lux/data/format/json.lux
+++ b/stdlib/source/lux/data/format/json.lux
@@ -16,7 +16,7 @@
[product]
(coll [list "list/" Fold<List> Monad<List>]
[sequence #+ Sequence sequence "sequence/" Monad<Sequence>]
- [dict #+ Dict]))
+ (dict ["dict" unordered #+ Dict])))
[macro #+ Monad<Meta> with-gensyms]
(macro ["s" syntax #+ syntax:]
[code]
diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux
index 29a4410fd..d3f3d6110 100644
--- a/stdlib/source/lux/data/format/xml.lux
+++ b/stdlib/source/lux/data/format/xml.lux
@@ -12,8 +12,8 @@
[product]
[maybe "m/" Monad<Maybe>]
[ident "ident/" Eq<Ident> Codec<Text,Ident>]
- (coll [list "L/" Monad<List>]
- ["d" dict]))))
+ (coll [list "list/" Monad<List>]
+ (dict ["d" unordered])))))
(type: #export Tag Ident)
(type: #export Attrs (d.Dict Ident Text))
@@ -191,8 +191,8 @@
(-> Attrs Text)
(|> attrs
d.entries
- (L/map (function (_ [key value])
- ($_ text/compose (write-tag key) "=" "\""(sanitize-value value) "\"")))
+ (list/map (function (_ [key value])
+ ($_ text/compose (write-tag key) "=" "\""(sanitize-value value) "\"")))
(text.join-with " ")))
(def: xml-header
@@ -216,7 +216,7 @@
($_ text/compose "<" tag attrs "/>")
($_ text/compose "<" tag attrs ">"
(|> xml-children
- (L/map recur)
+ (list/map recur)
(text.join-with ""))
"</" tag ">")))))))
@@ -254,7 +254,7 @@
(exception: #export (Unconsumed-Inputs {inputs (List XML)})
(|> inputs
- (L/map (:: Codec<Text,XML> encode))
+ (list/map (:: Codec<Text,XML> encode))
(text.join-with "\n\n")))
(def: #export text
diff --git a/stdlib/source/lux/lang/syntax.lux b/stdlib/source/lux/lang/syntax.lux
index 88a784980..1a9b5e84c 100644
--- a/stdlib/source/lux/lang/syntax.lux
+++ b/stdlib/source/lux/lang/syntax.lux
@@ -1,4 +1,4 @@
-## This is the LuxC's parser.
+## This is LuxC's parser.
## It takes the source code of a Lux file in raw text form and
## extracts the syntactic structure of the code from it.
## It only produces Lux Code nodes, and thus removes any white-space
@@ -38,7 +38,7 @@
(text ["l" lexer]
format)
(coll [sequence #+ Sequence]
- [dict #+ Dict]))))
+ (dict ["dict" unordered #+ Dict])))))
(type: #export Aliases (Dict Text Text))
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux
index 7582e8a62..f7914f189 100644
--- a/stdlib/source/lux/macro/poly.lux
+++ b/stdlib/source/lux/macro/poly.lux
@@ -7,7 +7,7 @@
[function]
(data [text "text/" Monoid<Text>]
(coll [list "list/" Fold<List> Monad<List> Monoid<List>]
- [dict #+ Dict])
+ (dict ["dict" unordered #+ Dict]))
[number "nat/" Codec<Text,Nat>]
[product]
[bool]
diff --git a/stdlib/source/lux/macro/poly/eq.lux b/stdlib/source/lux/macro/poly/eq.lux
index a5b312a2d..d3a06fd30 100644
--- a/stdlib/source/lux/macro/poly/eq.lux
+++ b/stdlib/source/lux/macro/poly/eq.lux
@@ -10,7 +10,7 @@
[array]
[queue]
(set ["set" unordered])
- [dict #+ Dict]
+ (dict ["dict" unordered #+ Dict])
(tree [rose]))
[number "nat/" Codec<Text,Nat>]
[product]
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux
index d2e73d4a8..8abfeb65e 100644
--- a/stdlib/source/lux/macro/poly/json.lux
+++ b/stdlib/source/lux/macro/poly/json.lux
@@ -15,7 +15,7 @@
[product]
(coll [list "list/" Fold<List> Monad<List>]
[sequence #+ Sequence sequence "sequence/" Monad<Sequence>]
- ["d" dict])
+ (dict ["d" unordered]))
(format ["//" json #+ JSON]))
(time ## ["i" instant]
["du" duration]
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 7172309d0..8e1dfd8fb 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -13,7 +13,7 @@
["c" complex])
(coll [list "list/" Fold<List>]
[array]
- [dict #+ Dict]
+ (dict ["dict" unordered #+ Dict])
[queue #+ Queue]
(set ["set" unordered #+ Set])
[stack #+ Stack]
diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux
index 88a2db2b8..fc08d01bc 100644
--- a/stdlib/source/lux/type/implicit.lux
+++ b/stdlib/source/lux/type/implicit.lux
@@ -7,7 +7,7 @@
text/format
[number]
(coll [list "list/" Monad<List> Fold<List>]
- [dict])
+ (dict ["dict" unordered #+ Dict]))
[bool]
[product]
[maybe])
@@ -122,7 +122,7 @@
[local-batches macro.locals
#let [total-locals (list/fold (function (_ [name type] table)
(dict.put~ name type table))
- (: (dict.Dict Text Type)
+ (: (Dict Text Type)
(dict.new text.Hash<Text>))
(list/join local-batches))]]
(wrap (|> total-locals
diff --git a/stdlib/source/lux/type/resource.lux b/stdlib/source/lux/type/resource.lux
index ce792af96..a95207ac8 100644
--- a/stdlib/source/lux/type/resource.lux
+++ b/stdlib/source/lux/type/resource.lux
@@ -9,7 +9,7 @@
[product]
[number]
text/format
- (coll [dict #+ Dict]
+ (coll (dict ["dict" unordered #+ Dict])
(set ["set" unordered])
[sequence #+ Sequence]
[list "list/" Functor<List> Fold<List>]))
diff --git a/stdlib/source/lux/world/env.jvm.lux b/stdlib/source/lux/world/env.jvm.lux
index ee20b9b1c..70b6a91ff 100644
--- a/stdlib/source/lux/world/env.jvm.lux
+++ b/stdlib/source/lux/world/env.jvm.lux
@@ -2,7 +2,7 @@
lux
(lux (data [text]
(format [context #+ Context])
- (coll [dict]))
+ (coll (dict ["dict" unordered])))
[io #- run]
[host]))
diff --git a/stdlib/test/test/lux/data/coll/ordered/dict.lux b/stdlib/test/test/lux/data/coll/dict/ordered.lux
index 301e64927..73a1ebcad 100644
--- a/stdlib/test/test/lux/data/coll/ordered/dict.lux
+++ b/stdlib/test/test/lux/data/coll/dict/ordered.lux
@@ -5,9 +5,9 @@
[eq #+ Eq])
(data [product]
[number]
- (coll (ordered ["&" dict])
- (set ["s" unordered])
- ["d" dict]
+ (coll (set ["s" unordered])
+ (dict ["dict" unordered]
+ ["&" ordered])
[list "L/" Functor<List>]))
["r" math/random])
lux/test)
diff --git a/stdlib/test/test/lux/data/coll/dict.lux b/stdlib/test/test/lux/data/coll/dict/unordered.lux
index 01074b6fc..73b0df822 100644
--- a/stdlib/test/test/lux/data/coll/dict.lux
+++ b/stdlib/test/test/lux/data/coll/dict/unordered.lux
@@ -7,7 +7,7 @@
text/format
[number]
[maybe]
- (coll ["&" dict]
+ (coll (dict ["&" unordered])
[list "list/" Fold<List> Functor<List>]))
["r" math/random])
lux/test)
diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux
index eec53b9cc..d302c63b0 100644
--- a/stdlib/test/test/lux/data/format/json.lux
+++ b/stdlib/test/test/lux/data/format/json.lux
@@ -14,7 +14,7 @@
[number]
(format ["@" json])
(coll [sequence #+ sequence]
- ["d" dict]
+ (dict ["d" unordered])
[list]))
[macro #+ with-gensyms]
(macro [code]
diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux
index ed337a0b7..80ac5bcb1 100644
--- a/stdlib/test/test/lux/data/format/xml.lux
+++ b/stdlib/test/test/lux/data/format/xml.lux
@@ -10,8 +10,8 @@
["E" error]
[maybe]
(format ["&" xml])
- (coll [dict]
- [list "L/" Functor<List>]))
+ (coll (dict ["dict" unordered])
+ [list "list/" Functor<List>]))
["r" math/random "r/" Monad<Random>]
test)
)
@@ -85,7 +85,7 @@
value (xml-text^ +1 +10)
#let [node (#&.Node tag
(dict.put attr value &.attrs)
- (L/map (|>> #&.Text) children))]]
+ (list/map (|>> #&.Text) children))]]
($_ seq
(test "Can parse text."
(E.default false
diff --git a/stdlib/test/test/lux/lang/syntax.lux b/stdlib/test/test/lux/lang/syntax.lux
index 2b4d6789f..49967e071 100644
--- a/stdlib/test/test/lux/lang/syntax.lux
+++ b/stdlib/test/test/lux/lang/syntax.lux
@@ -8,7 +8,7 @@
(text format
["l" lexer])
(coll [list]
- [dict #+ Dict]))
+ (dict ["dict" unordered #+ Dict])))
["r" math/random "r/" Monad<Random>]
(macro [code])
(lang ["&" syntax])
diff --git a/stdlib/test/test/lux/math/random.lux b/stdlib/test/test/lux/math/random.lux
index eed882ea7..45c83016c 100644
--- a/stdlib/test/test/lux/math/random.lux
+++ b/stdlib/test/test/lux/math/random.lux
@@ -10,7 +10,7 @@
[queue]
[stack]
(set ["set" unordered])
- [dict]))
+ (dict ["dict" unordered])))
(math ["r" random]))
lux/test)
diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux
index 9739c63e5..2c462e248 100644
--- a/stdlib/test/tests.lux
+++ b/stdlib/test/tests.lux
@@ -43,7 +43,8 @@
["_." xml])
(coll ["_." array]
["_." bits]
- ["_." dict]
+ ["_." dict/unordered]
+ ["_." dict/ordered]
["_." list]
["_." queue]
["_." set/unordered]
@@ -53,8 +54,7 @@
["_." priority-queue]
["_." stream]
(tree ["tree_." rose]
- ["tree_." zipper])
- (ordered ["ordered_." dict]))
+ ["tree_." zipper]))
(text ["_." format]
["_." lexer]
["_." regex]))