Refactoring Recursion
summary
Claim: recursion schemes specialized to List let you refactor recursion out of functions without needing Fix for most cases. Demonstrations use concrete tools: fold/right, unfold, cata/anamorphism, ana/para/histo/futu variants, with runnable examples (sum, length, replicate, fibs, merge, sliding windows, insert, swap). About a dozen schemes appear in 50 minutes; slides are executable and examples compile and run. When deeper needs arise, Fix plus deriving Foldable/Traversable shows how to refactor recursion out of data.
AI-written summary · about
chapters (28)
- 0:00Intro
- 1:45Why Refactor
- 3:30Recursion
- 4:35Explicit recursion
- 5:42Fold recursion
- 7:08Length recursion
- 9:02Recursion Explicit
- 9:32Catamorphism
- 12:51Filter
- 19:56Replicate
- 21:14Computing Fibs
- 23:06Section in Haskell
- 24:18Arrows
- 26:04Merging Lists
- 28:05HighLowmorphisms
- 30:02HighLowmorphism
- 33:36Deforestation
- 34:18Pair amorphism
- 35:57Paramorphism
- 38:55Comorphism
- 41:12Insert Element
- 45:08Listmorphisms
- 47:11Histomorphism
- 47:34History
- 50:43Histogram
- 52:04Fibs
- 55:58Fix
- 56:51Swap
related talks
25mFrom `goto` Statements to Recursion Schemes
01h 35mRecursion Schemes, Algebras, Finally Tagless, Data Types
26mThe Power Of Small Abstractions
01h 04mRefactoring Is Not Just Clickbait
01h 37mThe Art of Program Derivation and Parallel Computation
01h 03mFunctional Programming Patterns for Mere Mortals
23mFree the Conqueror! (Refactoring divide-and-conquer functions)
57mUnlocking The Awesome Power of Refactoring
