From `goto` Statements to Recursion Schemes
summary
Claims that extracting recursion patterns yields more correct, fusible, and reusable code, demonstrated by the Scala library matryoshka which encodes schemes like catamorphism, anamorphism, paramorphism and hylomorphism. The uploader notes the codebase enables a wart that warns on explicit recursion. Recursion schemes provide monadic variants for error handling and fusion to avoid multiple traversals; some implementations are not stack-safe, so adoption sometimes costs extra thought even when it simplifies reasoning and performance.
AI-written summary · about
chapters (8)
- 0:00Intro
- 1:20Unstructured Programming
- 6:20Common Patterns
- 8:30Recursion Patterns
- 10:20Notation
- 12:32Animorphs
- 16:38Recursion Schemes
- 20:35Conclusion
related talks
01h 03mRefactoring Recursion
01h 35mRecursion Schemes, Algebras, Finally Tagless, Data Types
49mMetaphorisms Deriving Divide and Conquer Recursive Programs
01h 03mFunctional Programming Patterns for Mere Mortals
01h 37mThe Art of Program Derivation and Parallel Computation
35mAvoiding code spaghetti by making ravioli
33mJourney to the Heart of the For-Yield
49mScalaz, or: how I learned to stop worrying and love monads
