Abstract. Their support for code reuse has made object-oriented languages popular. However, they do not succeed equally in all areas, particularly when data has a complex structure, making hard to keep the parallel between data and code.
On the other hand, functional programming languages, which separate data from code, are better at handling complex structures, but they do not provide direct ways to reuse code for a different datatype.
We show here a way to achieve code reuse, even when data and code are separated. The method is illustrated by a detailed example.
You can get the A4 postscript version of this paper.
Here is the code for examples in the paper: