diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/coll/dict.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/data/coll/dict.lux b/stdlib/source/lux/data/coll/dict.lux index 6a11dcc77..47929c72f 100644 --- a/stdlib/source/lux/data/coll/dict.lux +++ b/stdlib/source/lux/data/coll/dict.lux @@ -572,28 +572,28 @@ (let [[Hash<K> node] dict] (get' root-level (:: Hash<K> hash key) key Hash<K> node))) -(def: #export (contains? key table) +(def: #export (contains? key dict) (All [K V] (-> K (Dict K V) Bool)) - (case (get key table) + (case (get key dict) #;None false (#;Some _) true)) -(def: #export (put~ key val table) +(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))) - (if (contains? key table) - table - (put key val table))) + (if (contains? key dict) + dict + (put key val dict))) -(def: #export (update key f table) +(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))) - (case (get key table) + (case (get key dict) #;None - table + dict (#;Some val) - (put key (f val) table))) + (put key (f val) dict))) (def: #export size (All [K V] (-> (Dict K V) Nat)) |