Racket functional programming: recursion, map, filter and fold
11 steps · about 8 h 5 min · Beginner
- Introduction to Functional Programming with Racket (video, YouTube, 15 min)
A short orientation to what functional style means in Racket before you write any code.
- 2.3 Lists, Iteration, and Recursion (doc, The Racket Guide (official), 40 min)
The official guide builds up from first/rest, to writing your own map, to tail recursion, so it is the core text for this list.
- Recursion and Applicative Programming (article, University of Washington CSE 341, 30 min)
Gives the base-case and smaller-problem template, with accumulators and tail recursion, in a form you can copy.
- Racket Programming The Fun Way (sample chapter 3) (article, No Starch Press, 35 min)
A free sample chapter that explains recursion and first-class functions with worked puzzles.
- Functional Programming (Racket): Map Function (video, YouTube, 10 min)
A short demo of map to check you have the idea before you go further.
- A Taste of Racket (article, Math ∩ Programming (Jeremy Kun), 25 min)
Shows how to write fold and filter yourself, and leaves foldr as an exercise.
- Functional Programming (Racket) Tutorial: Foldr (video, YouTube, 10 min)
Foldr is the hardest of the three to grasp, so a walkthrough helps here.
- Higher-Order List Functions in Racket (article, Wellesley CS251, 30 min)
Shows how map, filter and foldr each capture one recursion pattern, so you can generalize your own recursive functions.
- High Order Functions (article, Mathematical Foundations of Computer Science, 30 min)
Practice with functions that take or return functions, including lambda and fold.
- 4.10 Pairs and Lists (reference, Racket Reference (official), 20 min)
The authoritative reference for map, filter, foldl and foldr, for checking details and argument order.
- How to Design Programs (doc, htdp.org (Felleisen, Findler, Flatt, Krishnamurthi), 4 h)
A free textbook for going further: it teaches a systematic design recipe for recursive functions and abstraction.