Notes on HW from Section 2.2
- Exercise 2.2.8 suggests you review your function
digitCount
from Ex 1.12.3.
This is a little misleading since although there are similarities, there
are important differences between the problems as well.
In particular, although digitCount(0)
should return 1
(since 0 has one digit, itself), digify(0)
should return []
(empty list)... since
that makes the rest of the problem easier.
Bonus hint: use not only div
(as in
digitCount
) to remove the least significant digit,
but use also mod
to retreive that digit.
- For Exercise 2.2.9, the hint is suggesting you set up
the problem this way:
fun cat([], yy) = ??
| cat(x::rest, yy) = ??
Thomas VanDrunen
Last modified: Fri Jan 27 12:47:34 CST 2017