Embedded Pattern Matching
summary
Presents a concrete technique that lets host-language pattern matching produce embedded-language case expressions by representing user ADTs as a sum-of-products representation (nested pairs), providing bi-directional pattern synonyms as builders and matchers, and running the match body twice via a staging match function that extracts each RHS. Implements this in Accelerate-style embeddings, handles Maybe/Point examples, automates matcher generation, and ships working prototypes and artifacts on GitHub.
AI-written summary · about
chapters (5)
- 0:00The problem of embedded DSLs
- 4:08Limitations of current methods
- 8:54Representing data types
- 13:03Leveraging pattern synonyms
- 15:24Solving the staging problem
related talks
01h 26mImplementing Dependent Pattern Matching and Type Unification Part 2
44mRevisiting pattern match overlap checks in Haskell
28mDesign Patterns for Parser Combinators (Functional Pearl)
23mHigher order Patterns in Rewrite Rules
28mExpress: applications of dynamically typed Haskell expressions
30mtypedKanren: Statically Typed Relational Programming with Exhaustive Matching in(…)
01h 38mGHC Core Optimisations
01h 07mHaskell The Legend of DSLs
