Liking cljdoc? Tell your friends :D

detritus.update

A collection of helper functions useful for updating and conditionally updating datastructures.

A collection of helper functions useful for updating and
conditionally updating datastructures.
raw docstring

->>when-updateclj

(->>when-update pred f & args)

Function of a predicate, an updater, optional varargs and a value. If the predicate is true of the value, returns (apply f x args), otherwise returns x.

Example: (->> 1 (->>when-update #(<= 0 %) inc))

Function of a predicate, an updater, optional varargs and a
value. If the predicate is true of the value, returns (apply f x
args), otherwise returns x.

Example:
  (->> 1 (->>when-update #(<= 0 %) inc))
sourceraw docstring

->when-updateclj

(->when-update x pred f & args)

Function of a value, a predicate, an updater and optional varargs. If the predicate is true of the value, returns (apply f x args), otherwise returns x.

Example: (-> 1 (->when-update #(<= 0 %) inc))

Function of a value, a predicate, an updater and optional
varargs. If the predicate is true of the value, returns (apply f x
args), otherwise returns x.

Example:
  (-> 1 (->when-update #(<= 0 %) inc))
sourceraw docstring

deep-mergeclj

(deep-merge v & vs)
sourceraw docstring

fixclj

(fix f dat)

λ (fn T → T) → T → T

Eagerly computes the fixed point combinator of the input function and value. As this computation is eager, it will terminate only when a fixed point is reached which may be never.

λ (fn T → T) → T → T

Eagerly computes the fixed point combinator of the input function
and value. As this computation is eager, it will terminate only when
a fixed point is reached which may be never.
sourceraw docstring

group-by-pclj

(group-by-p pred coll)
source

lazy-group-by-pclj

(lazy-group-by-p pred coll)
source

map-entryclj

(map-entry x y)
source

map-keyscljdeprecated

Colloquial term for transforming the domain.

Colloquial term for transforming the domain.
sourceraw docstring

map-keys-and-valsclj

(map-keys-and-vals m f & args)

Create a new map from m by calling function f on each key & each value to get a new key & value

Create a new map from m by calling function f on each key & each
value to get a new key & value
sourceraw docstring

map-valscljdeprecated

Colloquial term for transforming the codomain.

Colloquial term for transforming the codomain.
sourceraw docstring

map-vals-with-keysclj

(map-vals-with-keys m f & args)

Create a new map from m by calling function f, with two arguments (the key and value) to get a new value.

Create a new map from m by calling function f, with two
arguments (the key and value) to get a new value.
sourceraw docstring

take-whenclj

(take-when f empty col)

Helper useful for parsing regular function argument seqeunces. If a predicate is satisfied, returns a pair [(first col), (rest col)] otherwise returns the pair [empty, col].

Ex. (let [[?docstring args] (take-when string? "" args) [?attr-map args] (take-when map? {} args)] ..)

Helper useful for parsing regular function argument seqeunces. If a predicate
is satisfied, returns a pair [(first col), (rest col)] otherwise returns the pair
[empty, col].

Ex. (let [[?docstring args] (take-when string? "" args)
          [?attr-map  args] (take-when map? {} args)]
      ..)
sourceraw docstring

update-codomainclj

(update-codomain m f & args)

Transforms a mapping (function) by applying the given transformation to all the elements of the codomain, returning a new mapping m' such that ∀k→v∈m, k→(f v & args)∈m'.

Transforms a mapping (function) by applying the given transformation
to all the elements of the codomain, returning a new mapping m' such
that ∀k→v∈m, k→(f v & args)∈m'.
sourceraw docstring

update-domainclj

(update-domain m f & args)

Transforms a mapping (function) by applying the given transformation to all the elements of the domain, returning a new mapping m' such that ∀k→v∈m, (f k & args)→v∈m'.

Transforms a mapping (function) by applying the given transformation
to all the elements of the domain, returning a new mapping m' such
that ∀k→v∈m, (f k & args)→v∈m'.
sourceraw docstring

update-keyscljdeprecated

Colloquial term for transforming the domain.

Colloquial term for transforming the domain.
sourceraw docstring

update-rangecljdeprecated

Colloquial term for transforming the codomain.

Colloquial term for transforming the codomain.
sourceraw docstring

update-valuescljdeprecated

Colloquial term for transforming the codomain.

Colloquial term for transforming the codomain.
sourceraw docstring

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

× close