3 ms·
That definition is just one of the many possible definitions. And one of the obscurer ones tbh. :) It’s an abstract concept that you can implement in many diff
by sfvisser 4y ago
That definition is just one of the many possible definitions. And one of the obscurer ones tbh. :)
It’s an abstract concept that you can implement in many different ways.
- chas 4y agoBut lenses as functional references are very common in the Haskell world, whereas the only place I've heard of anamorphisms (unfolds) being referred to as lenses is in this paper. It also confused me quite a bit when I first ran into it, but the name just comes from the notation used in the paper. It is super hard to google for other references to anamorphisms being called lenses for short though because of yet another unrelated concept: https://en.wikipedia.org/wiki/Anamorphic_format https://en.wikipedia.org/wiki/Anamorphic_format
- hither_shores 4y agoExplicit getter-setter lenses and profunctor lenses are not quite the same thing, although they happen to be equivalent in Haskell. For example: the getter-setter encoding only works when you have diagonals (~ copying data).