Exercise 1: Extend zero

July 20, 2016 ยท View on GitHub

The first exercise is to extend the zero function we have just seen.

In the glambda repo, look in the exercises directory and open up Ex1.hs. The code we've been discussing should appear.

Add constructors for

  • [] (the list type)
  • Wrap (defined in the file)
  • () (the unit type), and
  • (->)

Add clauses of zero for these as well.

The solution is available in Ex1.hs in the solutions branch.