Case study: Huffman codes
To present the basics of the Miranda module system: %include and
To introduce the basic rules of modular design, and to illustrate their use in
a substantial case study.
To introduce the Huffman
coding and decoding mechanisms, as examples of interesting non-trivial
Other case studies
Of necessity any reasonable examples of sets of modules will be sizable.
It would be a useful exercise to give a graphical representation of these sets
of modules, and also to explore ways in which the systems might be structured
The simulation, interaction and calculator examples from this text can be
found in the directories Simulation, Interactions and
Calculator found in the code distribution. For details of how to
obtain the code click
The examples of regular expressions and program semantics given on the further
work page also contain systems of modules. For more details click
It would also be a useful exercise to examine earlier projects, such as the
supermarket billing exercises, to see how they might be modularised.
Written 18 May 1995.