|
|
|
|
|
by tikhonj
3645 days ago
|
|
No. It's more the sheer breadth and scope of the vocabulary lens develops. It has a ton of operations and abstractions, all written in a distinctly "lensy" style with their own idioms. They fit together beautifully, but are distinct enough from normal Haskell style that learning them takes additional effort. If you just had a small subset of the library that only exposed, say, Lens, Traversal and Prism, it would be much more approachableābut would also miss out on much of what makes lens so universally useful. It wouldn't hit all the edge cases lens does and it wouldn't be "batteries included". You'd find yourself ultimately reinventing part of the other abstractions that lens has but, since you're doing it independently and ad-hoc, the result would be uglier. |
|
Do you have any recommendations on what might be a good read or project for learning Lens? I played around with it a couple times, but I could never find an introduction or anything that really let me get a grasp on their core concepts and use. I'm not looking so much for the mechanics of how to use them, but more of an overview of when and why I might want to use them.