4 ms·
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 op
by lindig 8y ago
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.
- mannykannot 8y agoWell, 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.