Pattern Functors...
summary
Haskell code turns data types into manipulable descriptions: a pattern functor = constructor shapes with recursion removed, tied by Fix to rebuild recursive types. Evidence: arithmetic expressions and lists become Functor-valued patterns, then get one-line generic folds and extensible datatypes “à la carte” with injection functions. Free monads appear by adding a hole functor to represent key-value programs whose interpretations run or simulate for testing. GHC Generics derives the conversions so the approach compiles and actually works.
AI-written summary · about
chapters (17)
- 0:00Start
- 7:54Decorated data types
- 9:32Quick recap of folds
- 14:10Our aim: extensibility
- 15:05How should
- 16:41Values require GOL/R
- 24:42Free monoid over a type
- 25:26Free monad, attempt #1
- 28:47Representing operations
- 32:00Two lessons to be learned
- 33:50Describing constructors
- 35:58Combining pattern functors
- 37:25Anonymous data types
- 40:02Generic representations
- 43:15Data type-generic (==)
- 48:01A piece of warning
- 50:29Homework (optional?)
related talks
43mDatafun: a functional query language
42mCategories for the Working Hacker
52mPolymorphic record types in a lifted enbedding
46mPolymorphic Record Types in a Limited Embedding
16mFlexible and Expressive Typed Path Patterns for GQL
17mFixpoints for the Masses: Programming with First-Class Datalog Constraints
48mA Helicopter Tour of Purely Functional Data Structures
52mData Over Code: A Short Hyperbole
