fantasy-lenses
fantasy-lenses copied to clipboard
adds fromArray
This adds Lens/PartialLens.fromArray
. It works with arrayLens
and objectLens
.
objectLens('location').andThen(objectLens('numbers')).andThen(arrayLens(0))
// ===
Lens.fromArray(['location', 'numbers', 0])
How do you like it? Do you want me to change anything?
refs #2
I'm in the process of moving to profunctor lenses, but I've got a lot to do on them. Unsure if we should move on this one?
hmm.. If you plan on moving towards profunctor lenses as a replacement for the current implementation, then I wouldn't move on this one. Did you see https://github.com/flunc/optics? I'm interested to see your implementation.
It's almost identical to that one (because it's a port of the purescript library), but I've moved out a lot of it to libraries. Hence the fantasy monoid library ;-)
On Wed, 17 Feb 2016, 19:38 Christoph Hermann [email protected] wrote:
hmm.. If you plan on moving towards profunctor lenses as a replacement for the current implementation, then I wouldn't move on this one. Did you see https://github.com/flunc/optics? I'm interested to see your implementation.
— Reply to this email directly or view it on GitHub https://github.com/fantasyland/fantasy-lenses/pull/5#issuecomment-185370005 .