Lecture Notes, Week 09
- Reversing lists
- Programming using accumulators
- Generic programming with lists
- Resources
- Structural recursion over lists
- Express interlude
- Example: computing the length of a list, generically
- Example: unparsing a polymorphic list in long hand, generically
- Example: unparsing a polymorphic list in short hand, generically
- Example: duplicating the elements of a list, generically
- Example: concatenating two lists, generically
- Example: list membership, generically
- Exercise 12
- Sets as lists, re2visited
- Exercise 13
- Solution for Exercise 13
- Exercise 14
- Exercise 15
- Exercise 16
- Example: the Cartesian product of two sets, generically
- Example: the Cartesian product of three sets, generically
- Exercise 17
- Structural recursion over lists using an accumulator
- Express interlude
- Example: computing the length of a list using an accumulator, generically
- Exercise 18
- Sets as lists, re3visited
- Exercise 19
- Solution for Exercise 19
- Exercise 20
- Exercise 21
- Exercise 22
- The map function for lists, generically
- Aftermath
- Exercise 23
- Exercise 24
- Postlude
- Post-poslude
- Exercise 25
- Partial solution for Exercise 25
- Solution for Exercise 25
- Exercise 26
- Exercise 27
- Resources
- Version
- The Art of Computer Science
- The polymorphic option type
- Exercises for Week 09
- Index of concepts for Week 09