The Expression Problem, Generalised
summary
Wadler’s 1998 formulation (add new cases and new functions without touching old code) expands from sum types to records and nested structures, and the concrete claim is that optics (lenses, prisms, traversals) provide the minimal interfaces needed to write all functions without rewriting data types. Examples include JSON-like records and nested case/record mixes; implementation cost is real—author reports about 700 lines of optics in Haskell and tedious instance work in Clojure—yet the solution works functionally with runtime and maintenance tradeoffs.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 2:12What is the expression problem
- 7:10Expression problem example
- 15:01Why it matters in real code
- 23:34Generalising the expression problem
- 33:11Optics as a solution
- 37:49Summary
- 38:12Q&A
related talks
18mThe Essence of Generalized Algebraic Data Types
21mCompositions for Free: Reasoning about Effectful Lenses
15mThe Simple Essence of Overloading: Making ad-hoc polymorphism more algebraic with(…)
21mEffectful Lenses: There and Back with Different Monads
42mProgramming with Math
35mPractical Normalization by Evaluation for EDSLs
19mFlexible Structure Editing of Well-Typed Expressions
17mHefty Algebras: Modular Elaboration of Higher-Order Algebraic Effects
