4 ms·
Lenses are a way to try to minimize that effect, because it does "kind of" happen. This is one end of what Wadler termed the expression problem, essentially mos
by tel 13y ago
Lenses are a way to try to minimize that effect, because it does "kind of" happen. This is one end of what Wadler termed the expression problem, essentially most languages are structured such that either the nouns or the verbs are complex since if they both are then you have n^2 interactions.
Haskell chooses to make functions complex to enable simpler data types. This means there's a lot of drive to have useful, abstract interfaces, but it also means that you have to protect against the kind of complexity you get when expanding your objects.
Lenses help to do this by abstracting "views" on objects so that you only have to update the lens... and that can be done automatically.