|
|
|
|
|
by dwohnitmok
1659 days ago
|
|
Sharing the copy is not what's solved by lenses. In a certain sense lenses are just a way to try to do away with the boilerplate of updating nested immutable data structures. It is very easy to write this boilerplate (in the sense that it is straightforward and hard to mess up). It's just mind-numbingly tedious. Although I don't know what you mean by growing lenses. Mutex + inner mutation is no easier than CAS (which is the usual solution with concurrent writing of immutable data structures) a la Java AtomicReference or STM (another popular one) and in my opinion significantly harder as soon as you have multiple mutexes. |
|
I am not against FP I think the point of "it is good if you can fix performance" is very accurate. I just think it is also important to acknowledge that the paradigm can be more complex in situations where it is supposed to help leading to a mixed bag.
Similar to distributed databases. Your database can now be phenomenally powerful but you can't do a stored proc anymore without losing that power.
It can be a very effective and totally worth it but it isn't a pure win necessarily.