aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/collection/dictionary.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/collection/dictionary.lux32
1 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/lux/data/collection/dictionary.lux b/stdlib/source/lux/data/collection/dictionary.lux
index f7a406c45..efb99a8b4 100644
--- a/stdlib/source/lux/data/collection/dictionary.lux
+++ b/stdlib/source/lux/data/collection/dictionary.lux
@@ -218,10 +218,10 @@
## Produces the index of a KV-pair within a #Collisions node.
(def: (collision-index Hash<k> key colls)
(All [k v] (-> (Hash k) k (Collisions k v) (Maybe Index)))
- (:: maybe.monad map product.left
- (array.find+ (function (_ idx [key' val'])
- (:: Hash<k> = key key'))
- colls)))
+ (\ maybe.monad map product.left
+ (array.find+ (function (_ idx [key' val'])
+ (\ Hash<k> = key key'))
+ colls)))
## When #Hierarchy nodes grow too small, they're demoted to #Base
## nodes to save space.
@@ -261,7 +261,7 @@
(#.Some (#.Right [key' val']))
(array.write! hierarchy-idx
- (put' (level-up level) (:: Hash<k> hash key') key' val' Hash<k> empty)
+ (put' (level-up level) (\ Hash<k> hash key') key' val' Hash<k> empty)
h-array)
#.None
@@ -318,12 +318,12 @@
## Otherwise, if it's being used by a KV, I compare the keys.
(#.Some (#.Right key' val'))
- (if (:: Hash<k> = key key')
+ (if (\ Hash<k> = key key')
## If the same key is found, I replace the value.
(#Base bitmap (update! idx (#.Right key val) base))
## Otherwise, I compare the hashes of the keys.
(#Base bitmap (update! idx
- (#.Left (let [hash' (:: Hash<k> hash key')]
+ (#.Left (let [hash' (\ Hash<k> hash key')]
(if (n.= hash hash')
## If the hashes are
## the same, a new
@@ -445,7 +445,7 @@
## If, however, there was a KV-pair instead of a sub-node.
(#.Some (#.Right [key' val']))
## Check if the keys match.
- (if (:: Hash<k> = key key')
+ (if (\ Hash<k> = key key')
## If so, remove the KV-pair and unset the BitPosition.
(#Base (unset-bit-position bit bitmap)
(remove! idx base))
@@ -492,16 +492,16 @@
(get' (level-up level) hash key Hash<k> sub-node)
(#.Some (#.Right [key' val']))
- (if (:: Hash<k> = key key')
+ (if (\ Hash<k> = key key')
(#.Some val')
#.None))
#.None))
## For #Collisions nodes, do a linear scan of all the known KV-pairs.
(#Collisions _hash _colls)
- (:: maybe.monad map product.right
- (array.find (|>> product.left (:: Hash<k> = key))
- _colls))
+ (\ maybe.monad map product.right
+ (array.find (|>> product.left (\ Hash<k> = key))
+ _colls))
))
(def: (size' node)
@@ -562,17 +562,17 @@
(def: #export (put key val dict)
(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)]))
+ [Hash<k> (put' root-level (\ Hash<k> hash key) key val Hash<k> node)]))
(def: #export (remove key dict)
(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)]))
+ [Hash<k> (remove' root-level (\ Hash<k> hash key) key Hash<k> node)]))
(def: #export (get key dict)
(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)))
+ (get' root-level (\ Hash<k> hash key) key Hash<k> node)))
(def: #export (contains? key dict)
(All [k v] (-> k (Dictionary k v) Bit))
@@ -722,4 +722,4 @@
(All [k] (Functor (Dictionary k)))
(def: (map f fa)
- (update@ #root (:: ..functor' map f) fa)))
+ (update@ #root (\ ..functor' map f) fa)))