Chapter 6
Generalization


Aims


Issues

Re-visiting earlier examples

The approach of the book is bottom-up, so on introducing more powerful techniques we re-visit earlier examples to see how their definitions might use the new techniques. This is worth emphasising both for the examples in the text and for any exercises or examples introduced earlier by the teacher.

Properties

It is worth spending some time exploring the idea that a function of type

    * -> bool
represents a property of objects of the type *; it is something that it is harder to get across than might first be thought. This makes filter somewhat less straightforward than map.

Generalising

The example of generalisation, given in Section 6.5, can be applied in many other circumstances. Again, it is useful to apply it to functions which the students have seen previously.

Next Up


Written 18 May 1995.