Due 5PM Wednesday, October 6.
Chapter 10:
Exercises 10.1 and 10.2 in SOE.
(Note: nothing needs to be turned in for this part of the assignment.)
(Warning: for some reason these examples do not work
properly -- the Hugs window mysteriously disappears when
draw is invoked!! I am trying to fix the
code (it used to work...) but until then, please work on the problems from
Chapter 11.)
(Update: by Wednesday 10/6 afternoon there will be a
new version of Hugs installed, in the folder "HugsNov02" on the Zoo Windows
machines. This is an older version of Hugs that does not exhibit the bug
mentioned above, so all of the SOE code should work.)
Chapter 11:
- Exercise 11.1 in SOE.
- Exercise 11.2 in SOE, but only for the 2nd fold law in Table 11.1,
and the third take/drop law in Table 11.2.
- Exercise 11.3 in SOE.
- Exercise 11.5 in SOE.
- Consider the example involving the tree data type in the lecture notes
for Chapter 11.
- Prove the lemma.
- Can you think of a useful generalization of this lemma, involving
just foldl or foldr
and (++), that would be suitable to add
to Table 11.1 or 11.2? Prove that it is correct.
- Prove that the evaluate function defined
recursively in Chapter 7 is equivalent to the
evaluate function defined in Problem 2 from Problem Set 3.
Solutions.