Free All The Things
summary
Claims a mechanical recipe to "free" many typeclass structures beyond monads and demonstrates it on free monads, applicatives, functors, monoids (becoming lists) and a free boolean algebra used for search predicates. Shows implementation pattern — AST + inject + interpreter + laws — plus optimizations like right-association and map fusion. Builds a partial evaluator that short-circuits and a serializable AST to serialize to github JSON/Protobuf, and reports these techniques work for analysis, optimization, and multiple interpreters.
AI-written summary · about
chapters (6)
- 0:00Start
- 8:48Transforming Free Monas
- 14:24Freeing The Functor
- 23:23Free Boolean Algebra
- 28:51Optimizing Boolean Algebras
- 33:09Resources
related talks
38mMonads Made Semi-Understandable
21mMonads Asking the Right Question
44mTelling the Truth with Types
44mFinite state machines
22mTransformation Function Called Higher-Order
33mStatically Typed Interpreters
55mHands on With Recursion Schemes - Part 2 of 2
34mCommunication, Expression, and Types: Your Compiler as an Ally
