Liking cljdoc? Tell your friends :D

instacheck.util


*rnd*clj

source

flatten-textclj/s

(flatten-text tree & [sep])

Take a tree (sequences hierarchy) and flattens it all the way to a single string (optionally separated by sep). Empty values (but not blank strings) are removed.

Take a tree (sequences hierarchy) and flattens it all the way to
a single string (optionally separated by sep). Empty values (but not
blank strings) are removed.
sourceraw docstring

flatten-text*clj/s

(flatten-text* tree)

Take a tree (sequences hierarchy) and flattens it all the way to a single sequence of numbers and strings. Empty values are removed.

Take a tree (sequences hierarchy) and flattens it all the way to
a single sequence of numbers and strings. Empty values are removed.
sourceraw docstring

remove-keyclj/s

(remove-key tree k)

Walk a tree removing every key/value where key match k

Walk a tree removing every key/value where key match k
sourceraw docstring

tree-depsclj/s

(tree-deps trees)

Takes a structure like {:a tree-a :b tree-b :c tree-c} and returns a map like {:a #{:b :c} :b #{:c} :c #{}} which means that :a appears in tree-b and tree-c, :b appears in tree-c, but :c does not appear in tree-a or tree-b.

Takes a structure like {:a tree-a :b tree-b :c tree-c} and returns
a map like {:a #{:b :c} :b #{:c} :c #{}} which means that :a appears
in tree-b and tree-c, :b appears in tree-c, but :c does not appear
in tree-a or tree-b.
sourceraw docstring

tree-distancesclj/s

(tree-distances trees start & [child-dists])

Applies Djikstra's algorithm to find the shortest paths in trees from start key to all the other top-level nodes/keys. Takes a trees structure, a child-dists map of maps (with all immediate parent-child distances) and a start node. Returns a map of keys from trees with values that are the distance (hops) from the start key to that node/key.

Applies Djikstra's algorithm to find the shortest paths in trees
from start key to all the other top-level nodes/keys. Takes a trees
structure, a child-dists map of maps (with all immediate
parent-child distances) and a start node. Returns a map of keys from
trees with values that are the distance (hops) from the start key to
that node/key.
sourceraw docstring

tree-matchesclj/s

(tree-matches pred? tree)

Return seq of pred? matches for any node in the tree.

Return seq of pred? matches for any node in the tree.
sourceraw docstring

weighted-rand-nthclj/s≠

(weighted-rand-nth vals-weights & [rnd])
clj

Take a sequence of val-weight pairs (can be a map of val to weights), chooses a weighted random value and returns [idx val].

Take a sequence of val-weight pairs (can be a map of val to
weights), chooses a weighted random value and returns [idx val].
source (clj)source (cljs)raw docstring

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

× close