The Power of Optics
summary
Shows concrete Haskell code using the Haskell lens package and Template Haskell-generated makeLenses to get, set and modify deeply nested records, plus hand-built lenses for tuples. Demonstrates lens composition to produce single-focus setters/getters, infix operators that mimic imperative chaining, and examples that translate several state updates into one composed expression. Mentions implementations like van Laarhoven and profunctor optics and posts slides for followup.
AI-written summary · about
chapters (15)
- 0:00Start
- 0:34The Power of Optics
- 0:50Agenda
- 1:56Setup
- 2:14Getters
- 3:09Real-World Example
- 4:03Comparison (Haskell)
- 4:18Comparison (C#)
- 4:29Creation
- 7:09Lens Composition
- 8:15Custom Lenses
- 9:08C#- Haskell (With Lenses!)
- 11:08Operators
- 11:46Chaining
- 12:19Next Steps
related talks
30mFunctional lenses for contemporary frameworks
39mProfunctor Optics for state management
01h 05mThe Imperatives Must Go!
49mBetter software design with domain modelling
52mPluggable Stackable API Implementations
42mSpecter: overcome your fear of nested Clojure data
01h 03mFunctional Programming Patterns for Mere Mortals
01h 44mPractical Observable Sharing
