glasses.protocols
comp-lens
(comp-lens lens-top lens-bottom)
takes 2 Lensables and cals comp-lens* on them
after coercing them to lenses
invoke-lens
(invoke-lens lens root)
takes a Lensable and calls invoke-lens* on it after
coercing it to a lens
Lens
protocol
members
comp-lens*
(comp-lens* lens-top lens-bottom)
compose 2 lenses `lens-to` and `lens-bottom` and returns a new lens.
That takes the root of the first lens and operates on the field of the second
lens
Lens[a,b] -> Lens[b, c] -> Lens[a, c]
invoke-lens*
(invoke-lens* lens root)
invoke the lens on some root
and returns a pair where the first item
is the field that the lens points to.
And the second item is a function that given a function
of the field returns a new root with the updated field included in it
traversal?
(traversal? lens)
returns true if the lens is a traversal
Lensable
protocol
members
->lens
(->lens lens)
returns something that implements the Lens protocol