diff options
39 files changed, 114 insertions, 114 deletions
diff --git a/stdlib/source/lux/data/coll/dictionary/ordered.lux b/stdlib/source/lux/data/coll/dictionary/ordered.lux index 5c616fa0b..3cea300f7 100644 --- a/stdlib/source/lux/data/coll/dictionary/ordered.lux +++ b/stdlib/source/lux/data/coll/dictionary/ordered.lux @@ -34,19 +34,19 @@ [black #Black] ) -(type: #export (Dict k v) +(type: #export (Dictionary k v) {#order (Order k) #root (Maybe (Node k v))}) (def: #export (new Order<k>) - (All [k v] (-> (Order k) (Dict k v))) + (All [k v] (-> (Order k) (Dictionary k v))) {#order Order<k> #root #.None}) ## TODO: Doing inneficient access of Order functions due to compiler bug. ## TODO: Must improve it as soon as bug is fixed. (def: #export (get key dict) - (All [k v] (-> k (Dict k v) (Maybe v))) + (All [k v] (-> k (Dictionary k v) (Maybe v))) (let [## (^open "T/") (get@ #order dict) ] (loop [node (get@ #root dict)] @@ -69,7 +69,7 @@ )))) (def: #export (contains? key dict) - (All [k v] (-> k (Dict k v) Bool)) + (All [k v] (-> k (Dictionary k v) Bool)) (let [## (^open "T/") (get@ #order dict) ] (loop [node (get@ #root dict)] @@ -88,7 +88,7 @@ (do-template [<name> <side>] [(def: #export (<name> dict) - (All [k v] (-> (Dict k v) (Maybe v))) + (All [k v] (-> (Dictionary k v) (Maybe v))) (case (get@ #root dict) #.None #.None @@ -108,7 +108,7 @@ (do-template [<name> <op>] [(def: #export (<name> dict) - (All [k v] (-> (Dict k v) Nat)) + (All [k v] (-> (Dictionary k v) Nat)) (loop [node (get@ #root dict)] (case node #.None @@ -242,7 +242,7 @@ )) (def: #export (put key value dict) - (All [k v] (-> k v (Dict k v) (Dict k v))) + (All [k v] (-> k v (Dictionary k v) (Dictionary k v))) (let [(^open "T/") (get@ #order dict) root' (loop [?root (get@ #root dict)] (case ?root @@ -465,7 +465,7 @@ (undefined))) (def: #export (remove key dict) - (All [k v] (-> k (Dict k v) (Dict k v))) + (All [k v] (-> k (Dictionary k v) (Dictionary k v))) (let [(^open "T/") (get@ #order dict) [?root found?] (loop [?root (get@ #root dict)] (case ?root @@ -520,13 +520,13 @@ ))) (def: #export (update key transform dict) - (All [k v] (-> k (-> v v) (Dict k v) (Maybe (Dict k v)))) + (All [k v] (-> k (-> v v) (Dictionary k v) (Maybe (Dictionary k v)))) (do maybe.Monad<Maybe> [old (get key dict)] (wrap (put key (transform old) dict)))) (def: #export (from-list Order<l> list) - (All [k v] (-> (Order k) (List [k v]) (Dict k v))) + (All [k v] (-> (Order k) (List [k v]) (Dictionary k v))) (L/fold (function (_ [key value] dict) (put key value dict)) (new Order<l>) @@ -534,7 +534,7 @@ (do-template [<name> <type> <output>] [(def: #export (<name> dict) - (All [k v] (-> (Dict k v) (List <type>))) + (All [k v] (-> (Dictionary k v) (List <type>))) (loop [node (get@ #root dict)] (case node #.None @@ -551,7 +551,7 @@ [values v (get@ #value node')] ) -(structure: #export (Equivalence<Dict> Equivalence<v>) (All [k v] (-> (Equivalence v) (Equivalence (Dict k v)))) +(structure: #export (Equivalence<Dictionary> Equivalence<v>) (All [k v] (-> (Equivalence v) (Equivalence (Dictionary k v)))) (def: (= reference sample) (let [Equivalence<k> (:: sample eq)] (loop [entriesR (entries reference) diff --git a/stdlib/source/lux/data/coll/dictionary/unordered.lux b/stdlib/source/lux/data/coll/dictionary/unordered.lux index 61d21b425..e971228bb 100644 --- a/stdlib/source/lux/data/coll/dictionary/unordered.lux +++ b/stdlib/source/lux/data/coll/dictionary/unordered.lux @@ -42,7 +42,7 @@ (type: Level Nat) ## Nodes for the tree data-structure that organizes the data inside -## Dicts. +## Dictionaries. (type: (Node k v) (#Hierarchy Nat (Array (Node k v))) (#Base BitMap @@ -540,47 +540,47 @@ colls))) ## [Exports] -(type: #export (Dict k v) +(type: #export (Dictionary k v) {#.doc "A dictionary implemented as a Hash-Array Mapped Trie (HAMT)."} {#hash (Hash k) #root (Node k v)}) (def: #export (new Hash<k>) - (All [k v] (-> (Hash k) (Dict k v))) + (All [k v] (-> (Hash k) (Dictionary k v))) {#hash Hash<k> #root empty}) (def: #export (put key val dict) - (All [k v] (-> k v (Dict k v) (Dict k v))) + (All [k v] (-> k v (Dictionary k v) (Dictionary k v))) (let [[Hash<k> node] dict] [Hash<k> (put' root-level (:: Hash<k> hash key) key val Hash<k> node)])) (def: #export (remove key dict) - (All [k v] (-> k (Dict k v) (Dict k v))) + (All [k v] (-> k (Dictionary k v) (Dictionary k v))) (let [[Hash<k> node] dict] [Hash<k> (remove' root-level (:: Hash<k> hash key) key Hash<k> node)])) (def: #export (get key dict) - (All [k v] (-> k (Dict k v) (Maybe v))) + (All [k v] (-> k (Dictionary k v) (Maybe v))) (let [[Hash<k> node] dict] (get' root-level (:: Hash<k> hash key) key Hash<k> node))) (def: #export (contains? key dict) - (All [k v] (-> k (Dict k v) Bool)) + (All [k v] (-> k (Dictionary k v) Bool)) (case (get key dict) #.None false (#.Some _) true)) (def: #export (put~ key val dict) {#.doc "Only puts the KV-pair if the key is not already present."} - (All [k v] (-> k v (Dict k v) (Dict k v))) + (All [k v] (-> k v (Dictionary k v) (Dictionary k v))) (if (contains? key dict) dict (put key val dict))) (def: #export (update key f dict) {#.doc "Transforms the value located at key (if available), using the given function."} - (All [k v] (-> k (-> v v) (Dict k v) (Dict k v))) + (All [k v] (-> k (-> v v) (Dictionary k v) (Dictionary k v))) (case (get key dict) #.None dict @@ -590,26 +590,26 @@ (def: #export (update~ key default f dict) {#.doc "Transforms the value located at key (if available), using the given function."} - (All [k v] (-> k v (-> v v) (Dict k v) (Dict k v))) + (All [k v] (-> k v (-> v v) (Dictionary k v) (Dictionary k v))) (put key (f (maybe.default default (get key dict))) dict)) (def: #export size - (All [k v] (-> (Dict k v) Nat)) + (All [k v] (-> (Dictionary k v) Nat)) (|>> product.right size')) (def: #export empty? - (All [k v] (-> (Dict k v) Bool)) + (All [k v] (-> (Dictionary k v) Bool)) (|>> size (n/= +0))) (def: #export (entries dict) - (All [k v] (-> (Dict k v) (List [k v]))) + (All [k v] (-> (Dictionary k v) (List [k v]))) (entries' (product.right dict))) (def: #export (from-list Hash<k> kvs) - (All [k v] (-> (Hash k) (List [k v]) (Dict k v))) + (All [k v] (-> (Hash k) (List [k v]) (Dictionary k v))) (list/fold (function (_ [k v] dict) (put k v dict)) (new Hash<k>) @@ -617,7 +617,7 @@ (do-template [<name> <elem-type> <side>] [(def: #export (<name> dict) - (All [k v] (-> (Dict k v) (List <elem-type>))) + (All [k v] (-> (Dictionary k v) (List <elem-type>))) (|> dict entries (list/map <side>)))] [keys k product.left] @@ -628,7 +628,7 @@ {#.doc "Merges 2 dictionaries. If any collisions with keys occur, the values of dict2 will overwrite those of dict1."} - (All [k v] (-> (Dict k v) (Dict k v) (Dict k v))) + (All [k v] (-> (Dictionary k v) (Dictionary k v) (Dictionary k v))) (list/fold (function (_ [key val] dict) (put key val dict)) dict1 (entries dict2))) @@ -637,7 +637,7 @@ {#.doc "Merges 2 dictionaries. If any collisions with keys occur, a new value will be computed by applying 'f' to the values of dict2 and dict1."} - (All [k v] (-> (-> v v v) (Dict k v) (Dict k v) (Dict k v))) + (All [k v] (-> (-> v v v) (Dictionary k v) (Dictionary k v) (Dictionary k v))) (list/fold (function (_ [key val2] dict) (case (get key dict) #.None @@ -649,7 +649,7 @@ (entries dict2))) (def: #export (re-bind from-key to-key dict) - (All [k v] (-> k k (Dict k v) (Dict k v))) + (All [k v] (-> k k (Dictionary k v) (Dictionary k v))) (case (get from-key dict) #.None dict @@ -661,7 +661,7 @@ (def: #export (select keys dict) {#.doc "Creates a sub-set of the given dict, with only the specified keys."} - (All [k v] (-> (List k) (Dict k v) (Dict k v))) + (All [k v] (-> (List k) (Dictionary k v) (Dictionary k v))) (let [[Hash<k> _] dict] (list/fold (function (_ key new-dict) (case (get key dict) @@ -671,7 +671,7 @@ keys))) ## [Structures] -(structure: #export (Equivalence<Dict> Equivalence<v>) (All [k v] (-> (Equivalence v) (Equivalence (Dict k v)))) +(structure: #export (Equivalence<Dictionary> Equivalence<v>) (All [k v] (-> (Equivalence v) (Equivalence (Dictionary k v)))) (def: (= test subject) (and (n/= (size test) (size subject)) diff --git a/stdlib/source/lux/data/coll/set/ordered.lux b/stdlib/source/lux/data/coll/set/ordered.lux index 4761b7409..2ad835849 100644 --- a/stdlib/source/lux/data/coll/set/ordered.lux +++ b/stdlib/source/lux/data/coll/set/ordered.lux @@ -9,7 +9,7 @@ (abstract: #export (Set a) {} - (//.Dict a a) + (//.Dictionary a a) (def: #export new (All [a] (-> (Order a) (Set a))) diff --git a/stdlib/source/lux/data/coll/set/unordered.lux b/stdlib/source/lux/data/coll/set/unordered.lux index 1d9942206..ba5b1e8eb 100644 --- a/stdlib/source/lux/data/coll/set/unordered.lux +++ b/stdlib/source/lux/data/coll/set/unordered.lux @@ -2,14 +2,14 @@ lux (lux (control [equivalence #+ Equivalence] [hash #+ Hash]) - (data (coll (dictionary ["dict" unordered #+ Dict]) + (data (coll (dictionary ["dict" unordered #+ Dictionary]) [list "list/" Fold<List>])) (type abstract))) (abstract: #export (Set a) {} - (Dict a a) + (Dictionary a a) (def: #export new (All [a] (-> (Hash a) (Set a))) diff --git a/stdlib/source/lux/data/format/context.lux b/stdlib/source/lux/data/format/context.lux index e84e29026..0eee7a061 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 (dictionary ["dict" unordered #+ Dict]))))) + (coll (dictionary ["dict" unordered #+ Dictionary]))))) (exception: #export (unknown-property {property Text}) property) (type: #export Context - (Dict Text Text)) + (Dictionary Text Text)) (type: #export (Property a) (p.Parser Context a)) diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 01652968f..af6348fef 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>] [row #+ Row row "row/" Monad<Row>] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) [macro #+ Monad<Meta> with-gensyms] (macro ["s" syntax #+ syntax:] [code]))) @@ -36,13 +36,13 @@ (#Number Number) (#String String) (#Array (Row JSON)) - (#Object (Dict String JSON))) + (#Object (Dictionary String JSON))) (do-template [<name> <type>] [(type: #export <name> <type>)] [Array (Row JSON)] - [Object (Dict String JSON)] + [Object (Dictionary String JSON)] ) (type: #export (Reader a) @@ -302,7 +302,7 @@ (def: #export (object parser) {#.doc "Parses a JSON object, assuming that every element can be parsed the same way."} - (All [a] (-> (Reader a) (Reader (Dict Text a)))) + (All [a] (-> (Reader a) (Reader (Dictionary Text a)))) (do p.Monad<Parser> [head any] (case head diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux index ddfb06249..2edae8971 100644 --- a/stdlib/source/lux/data/format/xml.lux +++ b/stdlib/source/lux/data/format/xml.lux @@ -16,7 +16,7 @@ (dictionary ["d" unordered]))))) (type: #export Tag Ident) -(type: #export Attrs (d.Dict Ident Text)) +(type: #export Attrs (d.Dictionary Ident Text)) (def: #export attrs Attrs (d.new ident.Hash<Ident>)) @@ -233,7 +233,7 @@ [(#Node reference/tag reference/attrs reference/children) (#Node sample/tag sample/attrs sample/children)] (and (ident/= reference/tag sample/tag) - (:: (d.Equivalence<Dict> text.Equivalence<Text>) = reference/attrs sample/attrs) + (:: (d.Equivalence<Dictionary> text.Equivalence<Text>) = reference/attrs sample/attrs) (n/= (list.size reference/children) (list.size sample/children)) (|> (list.zip2 reference/children sample/children) diff --git a/stdlib/source/lux/lang/compiler/analysis/case/coverage.lux b/stdlib/source/lux/lang/compiler/analysis/case/coverage.lux index 825a9e9df..20000a8e0 100644 --- a/stdlib/source/lux/lang/compiler/analysis/case/coverage.lux +++ b/stdlib/source/lux/lang/compiler/analysis/case/coverage.lux @@ -9,7 +9,7 @@ [maybe] text/format (coll [list "list/" Fold<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [//// "operation/" Monad<Operation>] [/// #+ Pattern Variant Operation]) @@ -52,7 +52,7 @@ (type: #export #rec Coverage #Partial (#Bool Bool) - (#Variant (Maybe Nat) (Dict Nat Coverage)) + (#Variant (Maybe Nat) (Dictionary Nat Coverage)) (#Seq Coverage Coverage) (#Alt Coverage Coverage) #Exhaustive) @@ -154,7 +154,7 @@ [(#Variant allR casesR) (#Variant allS casesS)] (and (n/= (cases allR) (cases allS)) - (:: (dict.Equivalence<Dict> =) = casesR casesS)) + (:: (dict.Equivalence<Dictionary> =) = casesR casesS)) [(#Seq leftR rightR) (#Seq leftS rightS)] (and (= leftR leftS) @@ -200,7 +200,7 @@ (cond (not (n/= (cases allSF) (cases allA))) (e.fail "Variants do not match.") - (:: (dict.Equivalence<Dict> Equivalence<Coverage>) = casesSF casesA) + (:: (dict.Equivalence<Dictionary> Equivalence<Coverage>) = casesSF casesA) redundant-pattern ## else diff --git a/stdlib/source/lux/lang/compiler/analysis/structure.lux b/stdlib/source/lux/lang/compiler/analysis/structure.lux index ed809135a..7307d6472 100644 --- a/stdlib/source/lux/lang/compiler/analysis/structure.lux +++ b/stdlib/source/lux/lang/compiler/analysis/structure.lux @@ -7,7 +7,7 @@ [product] [maybe] (coll [list "list/" Functor<List>] - (dictionary ["dict" unordered #+ Dict])) + (dictionary ["dict" unordered #+ Dictionary])) text/format) [macro] (macro [code])) @@ -320,7 +320,7 @@ (if (dict.contains? idx idx->val) (///.throw cannot-repeat-tag [key record]) (wrap (dict.put idx val idx->val)))))) - (: (Dict Nat Code) + (: (Dictionary Nat Code) (dict.new number.Hash<Nat>)) record) #let [ordered-tuple (list/map (function (_ idx) (maybe.assume (dict.get idx idx->val))) diff --git a/stdlib/source/lux/lang/compiler/extension.lux b/stdlib/source/lux/lang/compiler/extension.lux index 3d1b6fcaf..19f993163 100644 --- a/stdlib/source/lux/lang/compiler/extension.lux +++ b/stdlib/source/lux/lang/compiler/extension.lux @@ -4,14 +4,14 @@ ["ex" exception #+ exception:]) (data [error #+ Error] [text] - (coll (dictionary ["dict" unordered #+ Dict])))) + (coll (dictionary ["dict" unordered #+ Dictionary])))) [// #+ Operation Compiler]) (type: #export (Extension i) (#Base i) (#Extension [Text (List (Extension i))])) -(with-expansions [<Bundle> (as-is (Dict Text (-> Text (Handler s i o))))] +(with-expansions [<Bundle> (as-is (Dictionary Text (-> Text (Handler s i o))))] (type: #export (Handler s i o) (-> (Compiler [s <Bundle>] (Extension i) (Extension o)) (Compiler [s <Bundle>] (List (Extension i)) (Extension o)))) diff --git a/stdlib/source/lux/lang/compiler/extension/analysis.lux b/stdlib/source/lux/lang/compiler/extension/analysis.lux index 77439643e..9a28ff39f 100644 --- a/stdlib/source/lux/lang/compiler/extension/analysis.lux +++ b/stdlib/source/lux/lang/compiler/extension/analysis.lux @@ -2,7 +2,7 @@ lux (lux (data [text] (coll [list "list/" Functor<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [///analysis #+ Analysis State] [///synthesis #+ Synthesis] [//] diff --git a/stdlib/source/lux/lang/compiler/extension/analysis/common.lux b/stdlib/source/lux/lang/compiler/extension/analysis/common.lux index 3cd23ed17..71df4c678 100644 --- a/stdlib/source/lux/lang/compiler/extension/analysis/common.lux +++ b/stdlib/source/lux/lang/compiler/extension/analysis/common.lux @@ -8,7 +8,7 @@ text/format (coll [list "list/" Functor<List>] [array] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) [lang] (lang (type ["tc" check])) [io #+ IO]) diff --git a/stdlib/source/lux/lang/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/lang/compiler/extension/analysis/host.jvm.lux index 826650ccc..ead713305 100644 --- a/stdlib/source/lux/lang/compiler/extension/analysis/host.jvm.lux +++ b/stdlib/source/lux/lang/compiler/extension/analysis/host.jvm.lux @@ -12,7 +12,7 @@ ["l" lexer]) (coll [list "list/" Fold<List> Functor<List> Monoid<List>] [array] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) [macro "macro/" Monad<Meta>] (macro [code] ["s" syntax]) @@ -198,7 +198,7 @@ ))) (def: #export boxes - (Dict Text Text) + (Dictionary Text Text) (|> (list ["boolean" "java.lang.Boolean"] ["byte" "java.lang.Byte"] ["short" "java.lang.Short"] @@ -562,7 +562,7 @@ (lang.throw cannot-convert-to-a-class (jvm-type-name type)))) (type: Mappings - (Dict Text Type)) + (Dictionary Text Type)) (def: fresh-mappings Mappings (dict.new text.Hash<Text>)) diff --git a/stdlib/source/lux/lang/compiler/extension/bundle.lux b/stdlib/source/lux/lang/compiler/extension/bundle.lux index ff4bd66ad..e68c391c6 100644 --- a/stdlib/source/lux/lang/compiler/extension/bundle.lux +++ b/stdlib/source/lux/lang/compiler/extension/bundle.lux @@ -5,7 +5,7 @@ (data [text] text/format (coll [list "list/" Functor<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [//]) (exception: #export (incorrect-arity {name Text} {arity Nat} {args Nat}) diff --git a/stdlib/source/lux/lang/compiler/extension/synthesis.lux b/stdlib/source/lux/lang/compiler/extension/synthesis.lux index c48f3e3a5..ca20b0738 100644 --- a/stdlib/source/lux/lang/compiler/extension/synthesis.lux +++ b/stdlib/source/lux/lang/compiler/extension/synthesis.lux @@ -1,9 +1,9 @@ (.module: lux (lux (data [text] - (coll (dictionary ["dict" unordered #+ Dict])))) + (coll (dictionary ["dict" unordered #+ Dictionary])))) [//]) (def: #export defaults - (Dict Text //.Synthesis) + (Dictionary Text //.Synthesis) (dict.new text.Hash<Text>)) diff --git a/stdlib/source/lux/lang/compiler/extension/translation.lux b/stdlib/source/lux/lang/compiler/extension/translation.lux index bc95ed1f4..2063d5fb2 100644 --- a/stdlib/source/lux/lang/compiler/extension/translation.lux +++ b/stdlib/source/lux/lang/compiler/extension/translation.lux @@ -1,9 +1,9 @@ (.module: lux (lux (data [text] - (coll (dictionary ["dict" unordered #+ Dict])))) + (coll (dictionary ["dict" unordered #+ Dictionary])))) [//]) (def: #export defaults - (Dict Text //.Translation) + (Dictionary Text //.Translation) (dict.new text.Hash<Text>)) diff --git a/stdlib/source/lux/lang/compiler/meta/archive.lux b/stdlib/source/lux/lang/compiler/meta/archive.lux index a3e9c0397..09dfa211a 100644 --- a/stdlib/source/lux/lang/compiler/meta/archive.lux +++ b/stdlib/source/lux/lang/compiler/meta/archive.lux @@ -7,7 +7,7 @@ [ident] [text] text/format - (coll (dictionary ["dict" unordered #+ Dict]))) + (coll (dictionary ["dict" unordered #+ Dictionary]))) (lang [type #+ :share]) (type abstract) (world [file #+ File])) @@ -93,7 +93,7 @@ ["New document's key" (describe (..signature (get@ #key new)))])) (type: #export Archive - (Dict Text (Ex [d] (Document d)))) + (Dictionary Text (Ex [d] (Document d)))) (def: #export empty Archive (dict.new text.Hash<Text>)) diff --git a/stdlib/source/lux/lang/compiler/meta/cache.lux b/stdlib/source/lux/lang/compiler/meta/cache.lux index 1d47121f9..dc5dda4a8 100644 --- a/stdlib/source/lux/lang/compiler/meta/cache.lux +++ b/stdlib/source/lux/lang/compiler/meta/cache.lux @@ -11,7 +11,7 @@ [text] text/format (coll [list "list/" Functor<List> Fold<List>] - (dictionary ["dict" unordered #+ Dict]) + (dictionary ["dict" unordered #+ Dictionary]) (set ["set" unordered #+ Set]))) (world [file #+ File System])) [//io #+ Context Module] @@ -140,7 +140,7 @@ #.None archive)) - (: (Dict Text [(List Module) (Ex [d] (Document d))]) + (: (Dictionary Text [(List Module) (Ex [d] (Document d))]) (dict.new text.Hash<Text>))))])) #let [candidate-entries (dict.entries candidate) candidate-dependencies (list/map (product.both id product.left) diff --git a/stdlib/source/lux/lang/compiler/meta/cache/dependency.lux b/stdlib/source/lux/lang/compiler/meta/cache/dependency.lux index 28fcfccc8..e6d94dc65 100644 --- a/stdlib/source/lux/lang/compiler/meta/cache/dependency.lux +++ b/stdlib/source/lux/lang/compiler/meta/cache/dependency.lux @@ -2,11 +2,11 @@ [lux #- Module] (lux (data [text] (coll [list "list/" Functor<List> Fold<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [///io #+ Module] [///archive #+ Archive]) -(type: #export Graph (Dict Module (List Module))) +(type: #export Graph (Dictionary Module (List Module))) (def: #export empty Graph (dict.new text.Hash<Text>)) diff --git a/stdlib/source/lux/lang/compiler/synthesis.lux b/stdlib/source/lux/lang/compiler/synthesis.lux index eece3c7ab..bd23523e3 100644 --- a/stdlib/source/lux/lang/compiler/synthesis.lux +++ b/stdlib/source/lux/lang/compiler/synthesis.lux @@ -2,12 +2,12 @@ [lux #- i64 Scope] (lux (control [monad #+ do]) (data [error #+ Error] - (coll (dictionary ["dict" unordered #+ Dict])))) + (coll (dictionary ["dict" unordered #+ Dictionary])))) [///reference #+ Register Variable Reference] [// #+ Operation Compiler] [//analysis #+ Environment Arity Analysis]) -(type: #export Resolver (Dict Variable Variable)) +(type: #export Resolver (Dictionary Variable Variable)) (type: #export State {#scope-arity Arity diff --git a/stdlib/source/lux/lang/compiler/synthesis/expression.lux b/stdlib/source/lux/lang/compiler/synthesis/expression.lux index 8a07b0aea..81cc89b08 100644 --- a/stdlib/source/lux/lang/compiler/synthesis/expression.lux +++ b/stdlib/source/lux/lang/compiler/synthesis/expression.lux @@ -4,7 +4,7 @@ ["ex" exception #+ exception:]) (data [maybe] (coll [list "list/" Functor<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [///reference] [///compiler "operation/" Monad<Operation>] [///analysis #+ Analysis] diff --git a/stdlib/source/lux/lang/compiler/synthesis/function.lux b/stdlib/source/lux/lang/compiler/synthesis/function.lux index 35b9e047e..5d31a947b 100644 --- a/stdlib/source/lux/lang/compiler/synthesis/function.lux +++ b/stdlib/source/lux/lang/compiler/synthesis/function.lux @@ -7,7 +7,7 @@ (data [maybe "maybe/" Monad<Maybe>] [error] (coll [list "list/" Functor<List> Monoid<List> Fold<List>] - (dictionary ["dict" unordered #+ Dict])))) + (dictionary ["dict" unordered #+ Dictionary])))) [///reference #+ Variable] [///compiler #+ Operation] [///analysis #+ Environment Arity Analysis] diff --git a/stdlib/source/lux/lang/compiler/translation.lux b/stdlib/source/lux/lang/compiler/translation.lux index 46f9ffd98..80c606f30 100644 --- a/stdlib/source/lux/lang/compiler/translation.lux +++ b/stdlib/source/lux/lang/compiler/translation.lux @@ -7,7 +7,7 @@ [text] text/format (coll [row #+ Row] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) (world [file #+ File])) [// #+ Operation Compiler] [//synthesis #+ Synthesis]) @@ -35,7 +35,7 @@ (type: #export (Buffer code) (Row [Ident code])) -(type: #export (Artifacts code) (Dict File (Buffer code))) +(type: #export (Artifacts code) (Dictionary File (Buffer code))) (type: #export (State anchor code) {#context Context diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux index e2cdc3e03..7170d29b7 100644 --- a/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux +++ b/stdlib/source/lux/lang/compiler/translation/scheme/extension.jvm.lux @@ -4,7 +4,7 @@ ["ex" exception #+ exception:]) (data [maybe] text/format - (coll (dictionary ["dict" unordered #+ Dict])))) + (coll (dictionary ["dict" unordered #+ Dictionary])))) (///// [reference #+ Register Variable] (host ["_" scheme #+ Computation]) [compiler "operation/" Monad<Operation>] diff --git a/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux b/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux index dbb02da7f..044b75cac 100644 --- a/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux +++ b/stdlib/source/lux/lang/compiler/translation/scheme/extension/common.jvm.lux @@ -8,7 +8,7 @@ text/format [number #+ hex] (coll [list "list/" Functor<List>] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) [macro #+ with-gensyms] (macro [code] ["s" syntax #+ syntax:]) @@ -23,7 +23,7 @@ (-> Translator (List Synthesis) (Operation Computation))) (type: #export Bundle - (Dict Text Extension)) + (Dictionary Text Extension)) (syntax: (Vector {size s.nat} elemT) (wrap (list (` [(~+ (list.repeat size elemT))])))) diff --git a/stdlib/source/lux/lang/syntax.lux b/stdlib/source/lux/lang/syntax.lux index 536588443..6211edf8a 100644 --- a/stdlib/source/lux/lang/syntax.lux +++ b/stdlib/source/lux/lang/syntax.lux @@ -37,9 +37,9 @@ (text ["l" lexer] format) (coll [row #+ Row] - (dictionary ["dict" unordered #+ Dict]))))) + (dictionary ["dict" unordered #+ Dictionary]))))) -(type: #export Aliases (Dict Text Text)) +(type: #export Aliases (Dictionary Text Text)) (def: white-space Text "\t\v \r\f") (def: new-line Text "\n") diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 4cf25eff7..0ed67fdf1 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>] - (dictionary ["dict" unordered #+ Dict])) + (dictionary ["dict" unordered #+ Dictionary])) [number "nat/" Codec<Text,Nat>] [product] [bool] @@ -24,7 +24,7 @@ (type [check])) )) -(type: #export Env (Dict Nat [Type Code])) +(type: #export Env (Dictionary Nat [Type Code])) (type: #export (Poly a) (p.Parser [Env (List Type)] a)) diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux index 89e403104..44fd60ed5 100644 --- a/stdlib/source/lux/macro/poly/equivalence.lux +++ b/stdlib/source/lux/macro/poly/equivalence.lux @@ -10,7 +10,7 @@ [array] [queue] (set ["set" unordered]) - (dictionary ["dict" unordered #+ Dict]) + (dictionary ["dict" unordered #+ Dictionary]) (tree [rose])) [number "nat/" Codec<Text,Nat>] [product] @@ -70,11 +70,11 @@ )) (do @ [[_ _ valC] (poly.apply ($_ p.seq - (poly.this dict.Dict) + (poly.this dict.Dictionary) poly.any Equivalence<?>))] (wrap (` (: (~ (@Equivalence inputT)) - (dict.Equivalence<Dict> (~ valC)))))) + (dict.Equivalence<Dictionary> (~ valC)))))) ## Models (~~ (do-template [<type> <eq>] [(do @ diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 18fd0ea2c..1c198c1fe 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -123,7 +123,7 @@ g!key (code.local-symbol "_______key") g!val (code.local-symbol "_______val")] [_ _ =val=] (poly.apply ($_ p.seq - (poly.this d.Dict) + (poly.this d.Dictionary) (poly.this .Text) Codec<JSON,?>//encode))] (wrap (` (: (~ (@JSON//encode inputT)) @@ -236,7 +236,7 @@ (p.codec (~! Codec<JSON,Qty>) //.any))))) (do @ [[_ _ valC] (poly.apply ($_ p.seq - (poly.this d.Dict) + (poly.this d.Dictionary) (poly.this .Text) Codec<JSON,?>//decode))] (wrap (` (: (~ (@JSON//decode inputT)) @@ -305,7 +305,7 @@ #list (List Frac) #variant Variant #tuple [Bool Frac Text] - #dict (Dict Text Frac)}) + #dict (Dictionary Text Frac)}) (derived: (Codec<JSON,?> Record)))} (with-gensyms [g!inputs] diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux index 198095bc8..887e53a9f 100644 --- a/stdlib/source/lux/math/random.lux +++ b/stdlib/source/lux/math/random.lux @@ -14,7 +14,7 @@ ["c" complex]) (coll [list "list/" Fold<List>] [array] - (dictionary ["dict" unordered #+ Dict]) + (dictionary ["dict" unordered #+ Dictionary]) [queue #+ Queue] (set ["set" unordered #+ Set]) [stack #+ Stack] @@ -236,11 +236,11 @@ (recur []))))) (:: Monad<Random> wrap (set.new Hash<a>)))) -(def: #export (dict Hash<a> size key-gen value-gen) - (All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dict k v)))) +(def: #export (dictionary Hash<a> size key-gen value-gen) + (All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v)))) (if (n/> +0 size) (do Monad<Random> - [kv (dict Hash<a> (dec size) key-gen value-gen)] + [kv (dictionary Hash<a> (dec size) key-gen value-gen)] (loop [_ []] (do @ [k key-gen diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux index b7e970685..85ebe33c3 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>] - (dictionary ["dict" unordered #+ Dict])) + (dictionary ["dict" unordered #+ Dictionary])) [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 Text Type) + (: (Dictionary 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 7cac8b536..60eeef73b 100644 --- a/stdlib/source/lux/type/resource.lux +++ b/stdlib/source/lux/type/resource.lux @@ -9,7 +9,7 @@ [product] [number] text/format - (coll (dictionary ["dict" unordered #+ Dict]) + (coll (dictionary ["dict" unordered #+ Dictionary]) (set ["set" unordered]) [row #+ Row] [list "list/" Functor<List> Fold<List>])) diff --git a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux index bb13ac532..bfcd4b569 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/ordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/ordered.lux @@ -12,7 +12,7 @@ ["r" math/random]) lux/test) -(context: "Dict" +(context: "Dictionary" (<| (times +100) (do @ [size (|> r.nat (:: @ map (n/% +100))) @@ -27,7 +27,7 @@ (n/< left right)) pairs) sorted-values (L/map product.right sorted-pairs) - (^open "&/") (&.Equivalence<Dict> number.Equivalence<Nat>)]] + (^open "&/") (&.Equivalence<Dictionary> number.Equivalence<Nat>)]] ($_ seq (test "Can query the size of a dictionary." (n/= size (&.size sample))) diff --git a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux index bde4810a5..3476898b6 100644 --- a/stdlib/test/test/lux/data/coll/dictionary/unordered.lux +++ b/stdlib/test/test/lux/data/coll/dictionary/unordered.lux @@ -17,14 +17,14 @@ (do @ [#let [capped-nat (:: r.Monad<Random> map (n/% +100) r.nat)] size capped-nat - dict (r.dict number.Hash<Nat> size r.nat capped-nat) + dict (r.dictionary number.Hash<Nat> size r.nat capped-nat) non-key (|> r.nat (r.filter (function (_ key) (not (&.contains? key dict))))) test-val (|> r.nat (r.filter (function (_ val) (not (list.member? number.Equivalence<Nat> (&.values dict) val)))))] ($_ seq - (test "Size function should correctly represent Dict size." + (test "Size function should correctly represent Dictionary size." (n/= size (&.size dict))) - (test "Dicts of size 0 should be considered empty." + (test "Dictionaries of size 0 should be considered empty." (if (n/= +0 size) (&.empty? dict) (not (&.empty? dict)))) @@ -35,7 +35,7 @@ (list.zip2 (&.keys dict) (&.values dict)))) - (test "Dict should be able to recognize it's own keys." + (test "Dictionary should be able to recognize it's own keys." (list.every? (function (_ key) (&.contains? key dict)) (&.keys dict))) @@ -82,26 +82,26 @@ _ false))) - (test "Additions and removals to a Dict should affect its size." + (test "Additions and removals to a Dictionary should affect its size." (let [plus (&.put non-key test-val dict) base (&.remove non-key plus)] (and (n/= (inc (&.size dict)) (&.size plus)) (n/= (dec (&.size plus)) (&.size base))))) - (test "A Dict should equal itself & going to<->from lists shouldn't change that." - (let [(^open) (&.Equivalence<Dict> number.Equivalence<Nat>)] + (test "A Dictionary should equal itself & going to<->from lists shouldn't change that." + (let [(^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)] (and (= dict dict) (|> dict &.entries (&.from-list number.Hash<Nat>) (= dict))))) - (test "Merging a Dict to itself changes nothing." - (let [(^open) (&.Equivalence<Dict> number.Equivalence<Nat>)] + (test "Merging a Dictionary to itself changes nothing." + (let [(^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)] (= dict (&.merge dict dict)))) (test "If you merge, and the second dict has overlapping keys, it should overwrite yours." (let [dict' (|> dict &.entries (list/map (function (_ [k v]) [k (inc v)])) (&.from-list number.Hash<Nat>)) - (^open) (&.Equivalence<Dict> number.Equivalence<Nat>)] + (^open) (&.Equivalence<Dictionary> number.Equivalence<Nat>)] (= dict' (&.merge dict' dict)))) (test "Can merge values in such a way that they become combined." diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index cb90b5df5..27e9850e0 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -44,7 +44,7 @@ (|> r.frac (:: @ map (f/* 1_000_000.0))) (r.unicode size) (r.row size gen-json) - (r.dict text.Hash<Text> size (r.unicode size) gen-json) + (r.dictionary text.Hash<Text> size (r.unicode size) gen-json) ))))) (context: "JSON" @@ -81,7 +81,7 @@ #text Text #maybe (Maybe Frac) #list (List Frac) - #dict (d.Dict Text Frac) + #dict (d.Dictionary Text Frac) ## #variant Variant ## #tuple [Bool Frac Text] #recursive Recursive @@ -113,7 +113,7 @@ (r.unicode size) (r.maybe r.frac) (r.list size r.frac) - (r.dict text.Hash<Text> size (r.unicode size) r.frac) + (r.dictionary text.Hash<Text> size (r.unicode size) r.frac) ## ($_ r.alt r.bool (r.unicode size) r.frac) ## ($_ r.seq r.bool r.frac (r.unicode size)) gen-recursive @@ -145,7 +145,7 @@ (:: text.Equivalence<Text> = (get@ #text recL) (get@ #text recR)) (:: (maybe.Equivalence<Maybe> number.Equivalence<Frac>) = (get@ #maybe recL) (get@ #maybe recR)) (:: (list.Equivalence<List> number.Equivalence<Frac>) = (get@ #list recL) (get@ #list recR)) - (:: (d.Equivalence<Dict> number.Equivalence<Frac>) = (get@ #dict recL) (get@ #dict recR)) + (:: (d.Equivalence<Dictionary> number.Equivalence<Frac>) = (get@ #dict recL) (get@ #dict recR)) ## (variant/= (get@ #variant recL) (get@ #variant recR)) ## (let [[tL0 tL1 tL2] (get@ #tuple recL) ## [tR0 tR1 tR2] (get@ #tuple recR)] diff --git a/stdlib/test/test/lux/data/format/xml.lux b/stdlib/test/test/lux/data/format/xml.lux index 27d904a98..acdd2aec8 100644 --- a/stdlib/test/test/lux/data/format/xml.lux +++ b/stdlib/test/test/lux/data/format/xml.lux @@ -52,7 +52,7 @@ [size (size^ +0 +2)] ($_ r.seq xml-identifier^ - (r.dict ident.Hash<Ident> size xml-identifier^ (xml-text^ +0 +10)) + (r.dictionary ident.Hash<Ident> size xml-identifier^ (xml-text^ +0 +10)) (r.list size gen-xml))))))) (context: "XML." diff --git a/stdlib/test/test/lux/lang/compiler/synthesis/function.lux b/stdlib/test/test/lux/lang/compiler/synthesis/function.lux index 92e5dcc72..ba7d015e2 100644 --- a/stdlib/test/test/lux/lang/compiler/synthesis/function.lux +++ b/stdlib/test/test/lux/lang/compiler/synthesis/function.lux @@ -9,7 +9,7 @@ [number] text/format (coll [list "list/" Functor<List> Fold<List>] - (dictionary ["dict" unordered #+ Dict]) + (dictionary ["dict" unordered #+ Dictionary]) (set ["set" unordered]))) (lang ["///." reference #+ Variable "variable/" Equivalence<Variable>] ["///." compiler] @@ -54,7 +54,7 @@ (let [current-env/size (list.size current-env) resolver (list/fold (function (_ [idx var] resolver) (dict.put idx var resolver)) - (: (Dict Nat Variable) + (: (Dictionary Nat Variable) (dict.new number.Hash<Nat>)) (list.enumerate current-env))] (do @ diff --git a/stdlib/test/test/lux/lang/syntax.lux b/stdlib/test/test/lux/lang/syntax.lux index 929ecaca0..d9a16b2c3 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] - (dictionary ["dict" unordered #+ Dict]))) + (dictionary ["dict" unordered #+ Dictionary]))) ["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 2096edcfe..46d9edef4 100644 --- a/stdlib/test/test/lux/math/random.lux +++ b/stdlib/test/test/lux/math/random.lux @@ -24,7 +24,7 @@ _queue (r.queue size r.nat) _stack (r.stack size r.nat) _set (r.set number.Hash<Nat> size r.nat) - _dict (r.dict number.Hash<Nat> size r.nat r.nat) + _dict (r.dictionary number.Hash<Nat> size r.nat r.nat) top r.nat filtered (|> r.nat (r.filter (n/<= top))) shuffle-seed r.nat |