Liking cljdoc? Tell your friends :D

active.clojure.lens


**clj/s

(** & lenses)

Return the product of several lenses, which means that each lens is held over an element of a collection in the order they appear in the argument list.

Return the product of several lenses, which means that each lens is
held over an element of a collection in the order they appear in the
argument list.
sourceraw docstring

++clj/s

(++ & lenses)

Returns a lens over some data structure that shows a sequence of elements that each of the given lenses show on that. Note that the behaviour is undefined if those lenses do not show distrinct parts of the data structure.

Returns a lens over some data structure that shows a sequence of
elements that each of the given lenses show on that. Note that the
behaviour is undefined if those lenses do not show distrinct parts
of the data structure.
sourceraw docstring

>>clj/s

(>> l1 & lmore)

Returns a concatenation of two or more lenses, so that the combination shows the value of the last one, in a data structure that the first one is put over.

Returns a concatenation of two or more lenses, so that the combination shows the
value of the last one, in a data structure that the first one is put
over.
sourceraw docstring

as-mapclj/s

A lens that views a sequence of pairs as a map.

A lens that views a sequence of pairs as a map.
sourceraw docstring

as-setclj/s

A lens that views a sequence as a set.

A lens that views a sequence as a set.
sourceraw docstring

at-indexclj/s

(at-index n)

Returns a lens that focuses on the value at position n in a sequence. The sequence must have >= n elements.

Returns a lens that focuses on the value at position n in a sequence.
The sequence must have >= n elements.
sourceraw docstring

containsclj/s

(contains v)

Returns a lens showing the membership of the given value in a set.

Returns a lens showing the membership of the given value in a set.
sourceraw docstring

defaultclj/s

(default dflt)

Returns a lens that shows nil as the given default value, but does not change any other value.

Returns a lens that shows nil as the given default value, but does not change any other value.
sourceraw docstring

ExplicitLenscljs

source

A lens focusing on the first element in a collection. It yanks nil if the collection is empty, and will not insert nil into an empty collection.

A lens focusing on the first element in a collection. It
yanks nil if the collection is empty, and will not insert nil into an empty collection.
sourceraw docstring

idclj/s

Identity lens, that just show a data structure as it is. It's also the neutral element of lens concatenation reacl.lens/>>.

Identity lens, that just show a data structure as it is.
It's also the neutral element of lens concatenation
reacl.lens/>>.
sourceraw docstring

isclj/s

(is v)

Returns a lens showing if a data structure equals the non-nil value v.

Returns a lens showing if a data structure equals the non-nil value v.
sourceraw docstring

lensclj/s

(lens yank shove & args)

Returns a new lens defined by the given yanker function, which takes a data structure and must return the focused value, and the given shover function which takes a data structure and the new value in the focus. Any additional arguments are passed unchanged to the yank and shove functions.

Returns a new lens defined by the given yanker function, which
takes a data structure and must return the focused value, and the
given shover function which takes a data structure and the new value
in the focus. Any additional arguments are passed unchanged to the yank
and shove functions.
sourceraw docstring

memberclj/s

(member key & [not-found])

Returns a lens showing the value mapped to the given key in a map, not-found or nil if key is not present. Note that when not-found (or nil) is shoved into the map, the association is removed.

Returns a lens showing the value mapped to the given key in a map,
not-found or nil if key is not present. Note that when not-found (or
nil) is shoved into the map, the association is removed.
sourceraw docstring

nel-headclj/s

A lens focusing on the first element in a non-empty collection. Behaviour on an empty collection is undefined.

A lens focusing on the first element in a non-empty
collection. Behaviour on an empty collection is undefined.
sourceraw docstring

nel-tailclj/s

A lens focusing on the all but the first element in a non-empty collection. Behaviour on an empty collection is undefined.

A lens focusing on the all but the first element in a non-empty collection.
Behaviour on an empty collection is undefined.
sourceraw docstring

overhaulclj/s

(overhaul data lens f)
(overhaul data lens f & args)

Updates data using a lens. The new value will be determined by applying f to the old value and any other supplied arguments.

Updates data using a lens.  The new value will be determined by
applying `f` to the old value and any other supplied arguments.
sourceraw docstring

posclj/s

(pos n)

A lens over the nth element in a collection. Note that when shoving a new value nils may be added before the given position, if the the collection is smaller.

A lens over the nth element in a collection. Note that when shoving a
new value nils may be added before the given position, if the the collection is smaller.
sourceraw docstring

shoveclj/s

(shove data lens v)

Shove a new value v into the given data value, as defined by the given lens, and return the updated data structure.

Shove a new value v into the given data value, as defined by the
given lens, and return the updated data structure.
sourceraw docstring

tailclj/s

A lens focusing on the all but the first element in a collection. Note that nil will be prepended when shoving into an empty collection.

A lens focusing on the all but the first element in a collection.
Note that nil will be prepended when shoving into an empty collection.
sourceraw docstring

voidclj/s

A trivial lens that just shows nil over anything, and does never change anything.

A trivial lens that just shows nil over anything, and does never change anything.
sourceraw docstring

xmapclj/s

(xmap f g & args)

Returns a "view lens", that transforms a whole data structure to something else (f) and back (g).

Returns a "view lens", that transforms a whole data structure
to something else (f) and back (g).
sourceraw docstring

yankclj/s

(yank data lens)

Yank a value from the given data value, as defined by the given lens.

Yank a value from the given data value, as defined by the given
lens.
sourceraw docstring

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

× close