Peeling the Banana: Recursion Schemes from First Principles
summary
Derives catamorphism from primitive recursion and functor algebras, implements generic folds and unfolds in Scala, and models factorial as a hylomorphism by composing a range coalgebra with a multiply algebra (no runtime tree built). Introduces the fixed-point type Fix to represent recursive types and reduce the in/out boilerplate, shows Scala code for cata/ana, and points to Matryoshka and Haskell’s recursion-schemes as ready libraries.
AI-written summary · about
chapters (19)
- 0:00Intro
- 1:41The kind of banana
- 4:16The journey
- 5:42Recursive data types
- 7:01Recursive collapse
- 10:21Generalized collapse
- 11:36Category Theory
- 13:49Higher Kinded Types
- 15:24Isomorphism
- 16:11Functors
- 17:34F-Algebras
- 19:02Catamorphisms
- 23:12Generalized building
- 23:55Anamorphism
- 25:44Generalized recursion
- 26:27Hylomorphism
- 28:23Boilerplate!
- 29:41Removing boilerplate
- 31:18Takeaways
related talks
29mIntroduction to Recursion Schemes
37mGoing bananas with recursion schemes for fixed point data types
56mAn introduction to recursion schemes
51mGoing bananas with recursion schemes for fixed point data types
38mRefactoring Recursion
32mRecursion schemes with Higherkindness
01h 02mGoing bananas with recursion schemes for fixed point data types
47mHands on With Recursion Schemes - Part 1 of 2
