Hacker News new | past | comments | ask | show | jobs | submit login

There's also simpler packages, right? Targeted at having less power, but being more understandable as a result.

Was lens-family one of the simpler ones?

    https://hackage.haskell.org/package/lens-family



There are a lot of lens packages. I'd roughly split them into the "Van Laarhoven style" and the "Abstract style".

In the Abstract Style there is `data-lens` and `fclabels`. These use some kind of packaged form of (getter,setter) and require a Category instance to compose using (.). They are all mutually incompatible with one another.

In the Van Laarhoven Style are `lens`, `lens-family`, and `lens-family-core` of which the last is the simplest. These are all mutually compatible, and compose automatically using regular function composition and the Prelude version of (.), but they're somewhat hairy to see at first since they must expose their underlying type (for subtyping purposes) and that one is pretty unexpectedly weird.

I recommend using Van Laarhoven style lenses. If you really want an abstract style lens, fclabels is the best I've been told.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: