Liking cljdoc? Tell your friends :D

io.jesi.backpack.collection


assoc-inclj/s

(assoc-in m & kvs)
source

assoc-some!clj/s

(assoc-some! tmap k v)

Assocs some value into a transitive map

Assocs some value into a transitive map
sourceraw docstring

collifyclj/s

(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
sourceraw docstring

concat!clj/s

(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
sourceraw docstring

conj!clj/s

(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.
sourceraw docstring

conj-some!clj/s

(conj-some! tcoll v)

Adds a value to the transitive collection if some

Adds a value to the transitive collection if some
sourceraw docstring

contains-any?clj/s

(contains-any? map & keys)
source

create-indexclj/s

(create-index ks)
source

default-changed-mergerclj/s

source

default-comparatorclj/s

source

diffclj/s

(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
sourceraw docstring

dissoc-allclj/s

(dissoc-all map & keys)
source

dissoc-inclj/s

(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
sourceraw docstring

distinct-byclj/s

(distinct-by key entities)
source

distinct-vals?clj/s

(distinct-vals? m)

Returns true if all the map values are unique

Returns true if all the map values are unique 
sourceraw docstring

empty->nilclj/s

(empty->nil x)

Returns nil if argument returns true for (clojure.core/empty?)

Returns `nil` if argument returns `true` for `(clojure.core/empty?)`
sourceraw docstring

filter-byclj/s

(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})
sourceraw docstring

filter-emptyclj/s

source

filter-key=clj/s

(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})
sourceraw docstring

filter-nil-keysclj/s

(filter-nil-keys map)

Filters out all nil key values from a map

Filters out all nil key values from a map
sourceraw docstring

filter-valuesclj/s

(filter-values pred map)
source

first-someclj/s

(first-some m & ks)
source

in?clj/s

(in? col el)
source

index-comparatorclj/s

(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`.
sourceraw docstring

map-leavesclj/s

(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
sourceraw docstring

redactclj/s

(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`
sourceraw docstring

reduce-leavesclj/s

(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
sourceraw docstring

remove-emptyclj/s

(remove-empty x)
source

remove-nil-valsclj/s

(remove-nil-vals map)

Shallowly removes nil values from a map

Shallowly removes nil values from a map
sourceraw docstring

rename-keys!clj/s

(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
sourceraw docstring

safe-empty?clj/s

(safe-empty? x)
source

select-non-nil-keysclj/s

(select-non-nil-keys m keys)
source

select-valsclj/s

(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
sourceraw docstring

sorted-map-by-indexclj/s

(sorted-map-by-index idx & keyvals)
source

sorted-map-by-orderclj/s

(sorted-map-by-order ks & keyvals)
source

sorted?clj/s

(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
sourceraw docstring

trans-reduceclj/s

(trans-reduce f [c & coll])
(trans-reduce f init coll)
source

trans-reduce-kvclj/s

(trans-reduce-kv f init coll)
source

transform-keysclj/s

(transform-keys f coll)

Recursively transforms all map keys in coll with f

Recursively transforms all map keys in coll with f
sourceraw docstring

translate-keysclj/s

(translate-keys kmap map)

Updates map with the keys from kmap

Updates map with the keys from kmap
sourceraw docstring

update!clj/s

(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.
sourceraw docstring

update-someclj/s

(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.
sourceraw docstring

update-some!clj/s

(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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close