Liking cljdoc? Tell your friends :D

had-utils.collections


borderclj

(border grid i)

grid should be a rectangular collection of collections. Adds i as a border around the supplied grid.

`grid` should be a rectangular collection of collections. Adds `i`
as a border around the supplied grid.
sourceraw docstring

border-and-flattenclj

(border-and-flatten grid i)

Borders grid with i and then makes it into a one dimensional vector

Borders `grid` with `i` and then makes it into a
one dimensional vector
sourceraw docstring

bordervclj

(borderv grid i)

grid should be a rectangular collection of collections. Adds i as a border around grid. Return a vector of vectors

`grid` should be a rectangular collection of collections. Adds `i`
as a border around `grid`. Return a vector of vectors
sourceraw docstring

bracketclj

(bracket coll i)

Add the element i to the start and end of coll.

Add the element `i` to the start and end of `coll`.
sourceraw docstring

bracketvclj

(bracketv coll i)

Add the element i to the start and end of coll and return a vector.

Add the element `i` to the start and end of `coll` and return a vector.
sourceraw docstring

count-byclj

(count-by f coll)

Return a map from the distinct values of f applied to coll to the frequencies they occur.

Return a map from the distinct values of `f` applied to `coll`
to the frequencies they occur.
sourceraw docstring

count-whenclj

(count-when coll)
(count-when coll f)

Count the number of elements in coll where f returns true. If not supplied use identity as f.

Count the number of elements in `coll` where `f` returns true.
If not supplied use identity as `f`.
sourceraw docstring

filter-firstclj

(filter-first pred coll)

Find the first element in coll for which pred returns true

Find the first element in `coll` for which `pred` returns true
sourceraw docstring

map-kvclj

(map-kv val-fn coll)
(map-kv key-fn val-fn coll)

Construct a new map from an existing one. Each of val-fn and key-fn (optional - default (fn [k _] k)) are a function of two arguments, the key and value. Note that to make the usage more natural the optional key-fn is the first argument when used.

Construct a new map from an existing one.
Each of `val-fn` and `key-fn` (optional - default `(fn [k _] k))` are
a function of two arguments, the key and value.
Note that to make the usage more natural the optional `key-fn`
is the first argument when used.
sourceraw docstring

multigetclj

(multiget vec indexes)

Return a vector of the values at all indexes in vec

Return a vector of the values at all `indexes` in `vec`
sourceraw docstring

neighbor-valsclj

(neighbor-vals grid cols loc & {:keys [:with-diagonal]})

grid is a 1-d flattened version of a 2-d grid with cols columns. Given the 1-d coordinate loc gives all values of horizontal and vertical neighbors in the grid in a vector.

`grid` is a 1-d flattened version of a 2-d grid with `cols` columns. Given the 1-d coordinate
`loc` gives all values of horizontal and vertical neighbors in the grid in a vector.
sourceraw docstring

neighborsclj

(neighbors cols loc & {:keys [:with-diagonal]})

loc is assumed to be a coordinate into a flattened two-dimensional grid with cols columens. Gives a vector of coordinates of the horizontal and vertical neighbors. Does not check bounds. If :with-diagonal is true includes diagonal neighbors as well.

`loc` is assumed to be a coordinate into a flattened two-dimensional grid with `cols` columens.
Gives a vector of coordinates of the horizontal and vertical neighbors. Does not check bounds.
If `:with-diagonal` is true includes diagonal neighbors as well.
sourceraw docstring

transposeclj

(transpose seqs)

Transpose a rectangular sequence of sequences.

Transpose a rectangular sequence of sequences.
sourceraw docstring

transposevclj

(transposev seqs)

Transpose a rectangular sequence of sequences, returning a vector of vectors.

Transpose a rectangular sequence of sequences,
returning a vector of vectors.
sourceraw docstring

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

× close