(assoc-some! tmap k v)
Assocs some value into a transitive map
Assocs some value into a transitive map
(collify)
(collify v)
Puts value v
in a vector if it is not a collection. Returns nil
if no value
Puts value `v` in a vector if it is not a collection. Returns `nil` if no value
(concat!)
(concat! tcoll)
(concat! tcoll seq)
(concat! tcoll seq & more)
Adds the values to the transient collection, returning tcoll. Concatenates of the elements in the supplied sequences
Adds the values to the transient collection, returning tcoll. Concatenates of the elements in the supplied sequences
(conj!)
(conj! tcoll)
(conj! tcoll val)
(conj! tcoll val & more)
Adds val to the transient collection, and return tcoll. The 'addition' may happen at different 'places' depending on the concrete type.
Adds val to the transient collection, and return tcoll. The 'addition' may happen at different 'places' depending on the concrete type.
(conj-some! tcoll v)
Adds a value to the transitive collection if some
Adds a value to the transitive collection if some
(diff existing updated)
(diff leaf-pred existing updated)
(diff leaf-pred comparator existing updated)
(diff leaf-pred comparator changed-merger existing updated)
Returns a map of paths which have changed :added, :changed, :removed, and :same
Returns a map of paths which have changed :added, :changed, :removed, and :same
(dissoc-in m path & paths)
Dissociates paths from a map. Any empty maps produced will be removed
Dissociates paths from a map. Any empty maps produced will be removed
(distinct-vals? m)
Returns true if all the map values are unique
Returns true if all the map values are unique
(empty->nil x)
Returns nil
if argument returns true
for (clojure.core/empty?)
Returns `nil` if argument returns `true` for `(clojure.core/empty?)`
(filter-by key-fn pred coll)
Filters a collection where a key matches a predicate e.g. (let [coll [{:id 1} {:id 2}] (filter-by :id (bp/p= 1) coll)) ; returns `({:id 1})
Filters a collection where a key matches a predicate e.g. (let [coll [{:id 1} {:id 2}] (filter-by :id (bp/p= 1) coll)) ; returns `({:id 1})
(filter-key= key-fn value coll)
Filters a collection where a key matches a value e.g. (let [coll [{:id 1} {:id 2}] (filter-key= :id 1 coll)) ; returns `({:id 1})
Filters a collection where a key matches a value e.g. (let [coll [{:id 1} {:id 2}] (filter-key= :id 1 coll)) ; returns `({:id 1})
(filter-nil-keys map)
Filters out all nil key values from a map
Filters out all nil key values from a map
(index-comparator idx)
(index-comparator idx not-found-fn)
Returns a comparator function that sorts based on the provided idx
map.
Takes an optional not-found-fn
that's called when a key is not found in the
idx
, takes a key and returns a sort index. The default not-found-fn
returns the count of idx
.
Returns a comparator function that sorts based on the provided `idx` map. Takes an optional `not-found-fn` that's called when a key is not found in the `idx`, takes a key and returns a sort index. The default `not-found-fn` returns the count of `idx`.
(map-leaves f coll)
(map-leaves f leaf-pred coll)
Traverses and applies the mapping function to each leaf of a data structure. The mapping function is given the path and value at that path
Traverses and applies the mapping function to each leaf of a data structure. The mapping function is given the path and value at that path
(redact keys m)
(redact keys m redacted-value)
Deeply replaces value of all the keys
in m
with the redacted-value
Deeply replaces value of all the `keys` in `m` with the `redacted-value`
(reduce-leaves f coll)
(reduce-leaves f init coll)
(reduce-leaves f init leaf-pred coll)
Traverses and reduces a data structure where the reducing function is given an accumulator, vector path and value at that path
Traverses and reduces a data structure where the reducing function is given an accumulator, vector path and value at that path
(remove-nil-vals map)
Shallowly removes nil values from a map
Shallowly removes nil values from a map
(rename-keys! tmap kmap)
Returns the transient map with the keys in kmap renamed to the vals in kmap
Returns the transient map with the keys in kmap renamed to the vals in kmap
(select-vals m ks)
Selects all values from a map using specified keys. Missing keys return nil
Selects all values from a map using specified keys. Missing keys return nil
(sorted? coll)
(sorted? comp coll)
True if a collection is sorted by means of a 2 or 3 way comparator
True if a collection is sorted by means of a 2 or 3 way comparator
(transform-keys f coll)
Recursively transforms all map keys in coll with f
Recursively transforms all map keys in coll with f
(translate-keys kmap map)
Updates map with the keys from kmap
Updates map with the keys from kmap
(update! tcoll k f)
(update! tcoll k f x)
(update! tcoll k f x y)
(update! tcoll k f x y z)
(update! tcoll k f x y z & more)
'Updates' a value in an transient associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value.
'Updates' a value in an transient associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value.
(update-some m k f & args)
Updates a key in a map with a function, only if the key is present and the result of f
is not nil.
Updates a key in a map with a function, only if the key is present and the result of `f` is not nil.
(update-some! tmap k f)
Replaces the value of a key in a transitive map if the result of the function is some
Replaces the value of a key in a transitive map if the result of the function is some
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close