cfhammill / lenses

Elegant Data Manipulation with Lenses
https://cfhammill.github.io/lenses
Other
27 stars 4 forks source link

`modify` #6

Closed cfhammill closed 6 years ago

cfhammill commented 6 years ago

I think in addition to view/over we need modify (a snappier name could be chosen as well) to encapsulate the pattern

over(d, lens, f(view(d, lens)))

cfhammill commented 6 years ago

Turns out that this is exactly over from lens, lset is just over with a constant function. Re-adding over