cats.labs.lens
both
(both one other)
Given two traversals, compose them in parallel. The getter of the resulting traversal will combine results from both traversals and the setter will update the state with both setters.
ffoci
(ffoci traversal s)
Given a traversal and a state, return the first value focused by the traversal.
filter
(filter applies?)
Given a predicate, return a traversal that focuses the elements that pass the predicate.
in
(in path)
(in path default)
Given a path and optionally a default value, return a lens that focuses the given path in an associative data structure.
key
(key k)
Given a key, returns a lens that focuses on the given key of an associative data structure.
lens
(lens getter setter)
Given a function for getting the focused value from a state (getter) and a function that takes the state and and update function (setter), constructs a lens.
over
(over st f s)
Given a setter, a function and a state, apply the function over the value focused by the setter.
passes
(passes applies?)
Given a predicate, return a lens that focuses in an element only if passes the predicate.
The lens is not well-behaved, depens on the outcome of the predicate.
put
(put st v s)
Given a setter, a new value and a state, replace the value focused by the lens with the new one.
select-keys
(select-keys ks)
Return a lens focused on the given keys in an associative data structure.
traversal
(traversal getter setter)
Given a function for getting the focused values from a state (getter) and a function that takes the state and and update function (setter), constructs a traversal.
units
(units one->other other->one)
Given a function from unit A to unit B and another in the opposite direction, construct a lens that focuses and updates a converted value.