io.randomseed.bankster.util.map

assoc-if

macro

added in 1.0.0

(assoc-if coll pred k val)

assoc-if-key

macro

added in 1.0.0

(assoc-if-key coll k pred val)

assoc-if-not

macro

added in 1.0.0

(assoc-if-not coll pred k val)

assoc-if-not-key

macro

added in 1.0.0

(assoc-if-not-key coll k pred val)

dissoc-in

added in 1.0.0

(dissoc-in m [k & ks :as keys])

Like assoc-in but removes entries. Leaves empty maps.

invert-in-sets

added in 1.0.0

(invert-in-sets m)(invert-in-sets m dst)

Like clojure.set/map-invert but preserves all possible values in sets.

lazy-get

macro

added in 1.0.0

(lazy-get m k exp)

Like get but the default value is not evaluated if the key is found.

map-keys

added in 1.0.0

(map-keys f m)(map-keys f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

map-keys-and-vals

added in 1.0.0

(map-keys-and-vals f m)(map-keys-and-vals f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function and values also updated by results of the same function. The function should return a sequential collection of 2 elements: first containing a new value of a key and second containing a new value of a transformed value associated with that key. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

map-keys-by-v

added in 1.0.0

(map-keys-by-v f m)(map-keys-by-v f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using and empty map.

map-of-sets-invert

added in 1.0.0

(map-of-sets-invert m)

Like clojure.set/map-invert but for map of sets (as values) to preserve all possible values (as keys of newly created map).

map-of-vectors-invert-flatten

added in 1.0.0

(map-of-vectors-invert-flatten m)

Like clojure.set/map-invert but for map of vectors (as values). Duplicated keys are replaced.

map-vals

added in 1.0.0

(map-vals f m)(map-vals f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

map-vals-by-k

added in 1.0.0

(map-vals-by-k f m)(map-vals-by-k f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

map-vals-by-kv

added in 1.0.0

(map-vals-by-kv f m)(map-vals-by-kv f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive keys and values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

map-values

added in 1.0.0

(map-values f coll)

Recursively transforms values of a coll using function f. The function should take a value and return new value.

remove-by-if-value-in

added in 1.0.0

(remove-by-if-value-in m pred only)

Removes map entries if the given predicate returns true and value is in the given set.

remove-empty-values

added in 1.0.0

(remove-empty-values m)(remove-empty-values m only)

Removes entries with empty values from a map.

remove-except

added in 1.0.0

(remove-except m keyseq)

remove-if-value

added in 1.0.0

(remove-if-value m pred)

remove-if-value-in

added in 1.0.0

(remove-if-value-in m vals)

remove-if-value-not-in

added in 1.0.0

(remove-if-value-not-in m vals)

remove-keys-ns

added in 1.0.2

(remove-keys-ns m)

Removes namespace component from qualified keys (keywords and symbols). Non-qualified identifiers and other data types are not renamed.

update-existing

added in 1.0.0

(update-existing coll k fun & more)

Updates the key k of the given collection coll by calling a function fun and passing optional arguments specified as additional arguments. Will not perform any update if the given key does not exist within the collection. Returns a collection.

update-missing

added in 1.0.0

(update-missing coll k fun & more)

update-values

added in 1.0.0

(update-values map vmap)(update-values map vmap create-keys?)

Returns the given map with its values identified with keys from vmap updated with the associated functions from vmap.

update-values-recur

added in 1.0.0

(update-values-recur map vmap)(update-values-recur map vmap create-keys?)

Returns the given map with its values identified with keys from vmap recursively updated with the associated functions from vmap. Shape is not reflected, second map (vmap) should be flat, searching for keys is recursive, including nested vectors.