Refactoring Recursion
summary
Shows concrete Haskell code that starts with explicit recursive sum/product/length and refactors each into folds, then implements fold/unfold/refold patterns on lists with runnable examples (catamorphism, anamorphism, hylomorphism, paramorphism, apomorphism, zygomorphism, histomorphism, futumorphism). Demonstrates fusion/deforestation that avoids intermediate lists, uses laziness for infinite streams, and explains factoring recursion out of data via Fix/unFix and deriving Foldable so the generic cata works on tree examples.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:32introduction
- 2:39explicit recursion
- 5:10catamorphism
- 7:52anamorphism
- 15:25paramorphism
- 20:59zygomorphism
related talks
56mAn introduction to recursion schemes
32mRecursion schemes with Higherkindness
29mIntroduction to Recursion Schemes
34mPeeling the Banana: Recursion Schemes from First Principles
37mGoing bananas with recursion schemes for fixed point data types
41mFunctional Programming for Dummies*
31mAbstract your representation and fix your functors
55mDeforestation and Program Fusion
