Closed ds300 closed 8 years ago
So Atom::derive is to Derivation as Lens is to CompositeLens.
Yep I've had this idea too for a while too. I think of it as the converse of a derivation / a way to call .set on a derivation.
I think your approach here is good.
So Atom::derive is to Derivation as Lens is to CompositeLens.
Exactly, yes.
I think your approach here is good.
Thanks :) I'm now mulling over whether to make a new 1-arity version of the top-level lens
function for this rather than adding compositeLens
.
At the moment 'lensed atoms' may only have one underlying atom. AFAICT there is no conceptual barrier to allowing more than one underlying atom, and only a minor implementation barrier. I propose adding an alternative to the Lens interface:
Instances of which would be passed to a new top-level function
compositeLens
to create lensed atoms: