Exercises for Week 09

Exercise 0

  1. At the top right and at the bottom right of the present page, there is a clickable word, “index”, to access the index of the current version of the lecture notes. Click on it and then peruse the index, making sure that its entries make sense to you (otherwise, click on them to check them out).
  2. The lecture notes start with updates (Chapter Lecture Notes for Intro to CS, updates). Make sure to check them out regularly, as they reflect the development of the lecture.
  3. Time permitting, do peruse the lecture notes of this week, reproducing their OCaml content.

Mandatory exercises

  • Exercise 2: investigating the equivalence of functions operating over lists
  • Exercise 8: instantiating list_fold_right with nil and cons
  • Exercise 14: instantiating list_fold_left with nil and cons
  • Exercise 26: zipping a pair of lists into a list of pairs

Exercise 27

As a continuation of Exercise 6 in Week 08, implement the unzip function using list_fold_right.

Exercise 28

As a continuation of Exercise 26, implement the zip function using list_fold_right.

Version

Added Exercises 27 and 28 [24 Mar 2021]

Finalized [21 Mar 2021]

Created [20 Mar 2021]

Table Of Contents

Previous topic

The polymorphic option type

Next topic

YSC1212 Lecture Notes, Week 10