Liking cljdoc? Tell your friends :D

flathead.deep


apply-specclj/s

(apply-spec specification)
(apply-spec specification argument-count)

Ramda apply spec for clojure. Creates a function, which produces an object of the same structure as the specification object. Object values are produced by applying the corresponding function in specification object to the arguments. All values in specification object must be functions. Specification object can be nested.

Ramda apply spec for clojure.
Creates a function, which produces an object of the same structure as the specification object.
Object values are produced by applying the corresponding function in specification object to the arguments.
All values in specification object must be functions. Specification object can be nested.
sourceraw docstring

deep-mergeclj/s

(deep-merge & vs)

Deeply merges nested maps. Same as deep-merge-with where merge function is last.

Deeply merges nested maps.
Same as deep-merge-with where merge function is last.
sourceraw docstring

deep-merge-withclj/s

(deep-merge-with f & values)

Deeply merges nested maps. If a key occurs in more than one map and any of the values is not a map then the mapping(s) from the latter (left-to-right) will be combined by calling (f val-in-result val-in-latter).

Deeply merges nested maps. If a key occurs in more than one map and
any of the values is not a map then the mapping(s)
from the latter (left-to-right) will be combined
by calling (f val-in-result val-in-latter).
sourceraw docstring

evolveclj/s

(evolve transformations object)

Ramda evolve for clojure.

Ramda evolve for clojure.
sourceraw docstring

map-valuesclj/s

(map-values f nested-map)
(map-values branch? f nested-map)

Map recursively all values of a nested associative structure. Supports any seqable objects (see seqable?). For maps the values are mapped using plain/map-values and for other seqable objects using map function. Note that map function will change seqable to a lazy sequence. A branch? predicate can be used to mark objects as part of structure and not a value. You can only mark seqable objects as branches. The default version treat all sequential objects and maps as branches.

Map recursively all values of a nested associative structure. Supports any seqable objects (see seqable?).
For maps the values are mapped using plain/map-values and for other seqable objects using map function.
Note that map function will change seqable to a lazy sequence.
A branch? predicate can be used to mark objects as part of structure and not a value.
You can only mark seqable objects as branches. The default version treat all sequential objects and maps as branches.
sourceraw docstring

sequence->mapclj/s

(sequence->map object)
(sequence->map convert? object)

Convert all seqable objects to a map using plain/sequence->map. Nils will be kept as nils.

A predicate function convert? can be used to define which seqable objects are converted. For example strings are seqable, but you typically do not want to convert them to maps.

Convert all seqable objects to a map using plain/sequence->map. Nils will be kept as nils.

A predicate function convert? can be used to define which seqable objects are converted.
For example strings are seqable, but you typically do not want to convert them to maps.
sourceraw docstring

tree->flatclj/s

(tree->flat tree)
(tree->flat conj-key branch? root-key tree)

Transforms a nested associative structure (map) to a flat one. Supports any seqable objects (see seqable?). Other sequences are transformed to maps using plain/sequence->map. This is an inverse of the plain/flat->tree function. The information of the original tree structure is preserved in the flat map keys. The nested structure is not allowed to contain cycles; it must be a finite tree.

Sequences are converted to maps in transformation: (comp flat->tree tree->flat)

Arguments:

  • A conj-key function defines how child keys are conjoined to the root key.
  • A branch? predicate can be used to mark objects as part of tree structure and not a value.
  • A root-key represent a key for the tree object.

The default version use paths as keys in flat map and treat all sequential objects and maps as branches. The flat map values are same values as in values function i.e. (= (-> tree tree->flat vals set) (-> tree values set)). The flatten namespace contains another variation which is using concatenated keys with separator.

Transforms a nested associative structure (map) to a flat one.
Supports any seqable objects (see seqable?). Other sequences are transformed to maps using plain/sequence->map.
This is an inverse of the plain/flat->tree function. The information of the original tree structure is preserved
in the flat map keys. The nested structure is not allowed to contain cycles; it must be a finite tree.

Sequences are converted to maps in transformation: `(comp flat->tree tree->flat)`

Arguments:
- A conj-key function defines how child keys are conjoined to the root key.
- A branch? predicate can be used to mark objects as part of tree structure and not a value.
- A root-key represent a key for the tree object.

The default version use paths as keys in flat map and treat all sequential objects and maps as branches.
The flat map values are same values as in values function i.e.
`(= (-> tree tree->flat vals set) (-> tree values set))`.
The flatten namespace contains another variation which is using concatenated keys with separator.
sourceraw docstring

valuesclj/s

(values nested-map)
(values branch? nested-map)

Find recursively all values of a nested associative structure using a depth-first search (DFS). Returns a lazy sequence of values. Supports any seqable objects (see seqable?). For maps the values are map values (vals) and for other seqable objects the sequence itself. A branch? predicate can be used to define if object is part of the nested structure or a value. Values are leafs in DFS. You can only mark seqable objects as branches. The default version treat all sequential objects and maps as branches.

Find recursively all values of a nested associative structure using a depth-first search (DFS).
Returns a lazy sequence of values. Supports any seqable objects (see seqable?).
For maps the values are map values (vals) and for other seqable objects the sequence itself.
A branch? predicate can be used to define if object is part of the nested structure or a value. Values are leafs in DFS.
You can only mark seqable objects as branches. The default version treat all sequential objects and maps as branches.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close