AQA 7517 4.12.3.1: List processing
The free BugBot lessons that teach this point, a robot to try it on, and the past-paper questions that test it.
What it covers
At GCSE a list was an array: a row of boxes you reach into by index, readings[3]. Functional languages think of a list differently, as something built up one item at a time, and process it by taking it apart one item at a time. This lesson covers that view of a list, the operations the exam names, and how recursion over a list replaces a loop.
- Head and tail
- The list operations
- Recursion over a list
- Why prepend is cheap and append is not
- A route as a list
Or do it in the simulator, with tasks that mark themselves
Lessons that teach it
- A13.6 List processing Functional programming
Lists as a head and a tail, the empty list, prepend and append, and recursion over a list to drive a route there and back. - A13.8 Project: the way out Functional programming
Sweep the bay, decide with a pipeline of pure functions built by composition, map, filter and fold, then drive out.
Try it on a robot
The task from A13.6 List processing, running here. Change the program and press Run.
The specification is AQA's own document; this page says which of our lessons teach point 4.12.3.1 and is not endorsed by the board.