3 ms·
Lenses, and going from lenses to optics more generally. You start with what looks like a bad reinvention of "dot notation" to deal with updates on nested record
by endgame 4y ago
Lenses, and going from lenses to optics more generally. You start with what looks like a bad reinvention of "dot notation" to deal with updates on nested records, but then as you generalise, it turns into a deep well to draw from. You get an incredibly powerful toolkit to query/summarise/transform/rewrite data structures, and it's the only library I know where compositionality is _enhanced_ by _exposing_ its inner workings:
Here is SPJ giving a talk on them: https://www.youtube.com/watch?v=k-QwBL9Dia0 https://www.youtube.com/watch?v=k-QwBL9Dia0
- lgas 4y agoDefinitely agree on lenses being one of the more mind blowing things I've encountered and eventually grokked in programming. I would also recommend https://www.youtube.com/watch?v=QZy4Yml3LTY https://www.youtube.com/watch?v=QZy4Yml3LTY as a good video on lenses in part because the latter portion has some pretty far-out examples of that deep well you mentioned.