aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/collection/dictionary.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/collection/dictionary.lux20
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux
index 49c684929..e86eb437b 100644
--- a/stdlib/source/library/lux/data/collection/dictionary.lux
+++ b/stdlib/source/library/lux/data/collection/dictionary.lux
@@ -6,10 +6,10 @@
[equivalence (#+ Equivalence)]
[functor (#+ Functor)]]
[control
+ ["." maybe]
["." try (#+ Try)]
["." exception (#+ exception:)]]
[data
- ["." maybe]
["." product]
[collection
["." list ("#\." fold functor monoid)]
@@ -207,7 +207,7 @@
... 1s within the bitmap.
(def: bitmap_size
(-> Bit_Map Nat)
- i64.count)
+ i64.ones)
... A mask that, for a given bit position, only allows all the 1s prior
... to it, which would indicate the bitmap-size (and, thus, index)
@@ -565,7 +565,7 @@
(get@ #..hash))
(def: .public (empty key_hash)
- {#.doc (doc "An empty dictionary.")}
+ {#.doc (example "An empty dictionary.")}
(All [k v] (-> (Hash k) (Dictionary k v)))
{#hash key_hash
#root empty_node})
@@ -611,8 +611,8 @@
(put key (f val) dict)))
(def: .public (upsert key default f dict)
- {#.doc (doc "Updates the value at the key; if it exists."
- "Otherwise, puts a value by applying the function to a default.")}
+ {#.doc (example "Updates the value at the key; if it exists."
+ "Otherwise, puts a value by applying the function to a default.")}
(All [k v] (-> k v (-> v v) (Dictionary k v) (Dictionary k v)))
(..put key
(f (maybe.else default
@@ -651,16 +651,16 @@
)
(def: .public (merged dict2 dict1)
- {#.doc (doc "Merges 2 dictionaries."
- "If any collisions with keys occur, the values of dict2 will overwrite those of dict1.")}
+ {#.doc (example "Merges 2 dictionaries."
+ "If any collisions with keys occur, the values of dict2 will overwrite those of dict1.")}
(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)))
(def: .public (merged_with f dict2 dict1)
- {#.doc (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.")}
+ {#.doc (example "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) (Dictionary k v) (Dictionary k v) (Dictionary k v)))
(list\fold (function (_ [key val2] dict)
(case (get key dict)
@@ -673,7 +673,7 @@
(entries dict2)))
(def: .public (re_bind from_key to_key dict)
- {#.doc (doc "If there is a value under 'from_key', remove 'from_key' and store the value under 'to_key'.")}
+ {#.doc (example "If there is a value under 'from_key', remove 'from_key' and store the value under 'to_key'.")}
(All [k v] (-> k k (Dictionary k v) (Dictionary k v)))
(case (get from_key dict)
#.None