Re:Lenses: Composable Getters and Setters for Functional Pro...
by lindig on Monday December 24, 2018 @11:18AM
(#18752772)
As pointed out in this thread, a lens has to return the modified object as it can't update it as a side effect. That is the reason no universal dot-like lens operator exists in Haskell but it needs to be composed based on the data structures that it targets.
[ Parent
| on HN ]
Re:Lenses: Composable Getters and Setters for Functional Pro...
by mannykannot on Monday December 24, 2018 @11:28AM
(#18752816)
Well, yes, but bear in mind that the absence of side effects is seen as a virtue in functional programming, and it is a point of view that I have considerable agreement with.