2 ms·
I would love to see some kind of table or diagram that shows all the various "optics" in some kind of structured format. Lenses are the only one that I can keep
by nerdponx 4y ago
I would love to see some kind of table or diagram that shows all the various "optics" in some kind of structured format. Lenses are the only one that I can keep straight in my head.
- endgame 4y agohttps://raw.githubusercontent.com/wiki/ekmett/lens/images/Hierarchy.png https://raw.githubusercontent.com/wiki/ekmett/lens/images/Hi... If you need to find it again, it shows up in the README which is in the github repo and the page on Hackage.
- hither_shores 4y agoThere are infinitely many, so all is out, but the standard ones are covered here: https://oleg.fi/gists/posts/2017-04-18-glassery.html https://oleg.fi/gists/posts/2017-04-18-glassery.html Page 10 of this paper has a table with references to some more exotic optics, though it's going to be hard to parse without some category theory: https://arxiv.org/pdf/2001.07488.pdf https://arxiv.org/pdf/2001.07488.pdf
- Tarean 4y agoThe optics library is a bit stricter, using separate types with implicit conversions to give better type errors, and the subtyping diagram is here https://hackage.haskell.org/package/optics-0.4.2/docs/Optics.html#g:3 https://hackage.haskell.org/package/optics-0.4.2/docs/Optics... The lens documentation has this diagram https://i.imgur.com/ALlbPRa.png https://i.imgur.com/ALlbPRa.png These both skip over indexed versions, and some niche optics like grates aren't in the libraries yet afaik