Sorting Morphisms

Sorting algorithms can be classiied in many diierent ways. The way presented here is by expressing the algorithms as functional programs and to classify them by means of their recursion patterns. These patterns on their turn can be classiied as the natural recursion patterns that destruct or construct a given data-type, the so called cata-and anamorphisms respectively. We show that the selection of the recursion pattern can be seen as the major design decision, in most cases leaving no more room for more decisions in the design of the sorting algorithm. It is also shown that the use of alternative data structures may lead to new sorting algorithms. This presentation also serves as a gentle, lightweight , introduction into the various morphisms.