An Intuition for List Folds
summary
Clear claim: fold left = a loop — it accumulates by iterating with an accumulator (examples in Haskell and C#: sum, product, length, reverse) and never terminates on infinite lists. Precise counterpoint: fold right = constructor replacement — it substitutes cons/nil (append, map, filter, sequence) and can sometimes produce results on infinite streams because it associates to the right. Several concrete code constructions are shown and they work as described.
AI-written summary · about
chapters (5)
- 0:00Start
- 5:54Haskell Notation
- 20:20Multiply the Integers of a List
- 29:11Haskell Expressions
- 35:48Flattening a List of Lists
related talks
58mMonoidal Catamorphisms
46mCorecursion, Codata, and Just a Little Combinatorial Game Theory
44mPeeling The Banana: Recursion Schemes from First Principles
18mFold, Paper, Scissors...
45mPractical Lambda Calculus
26mEssential Functional Structures: Functor, Applicative and Traverse
43mThinking Functionally with C#
01h 39mIsomorphic Reasoning: Counting with Types Part 1
