Science of Computer Programming - Special issue on mathematics of program construction
The art of computer programming, volume 3: (2nd ed.) sorting and searching
The art of computer programming, volume 3: (2nd ed.) sorting and searching
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire
Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture
Towards a Mathematical Operational Semantics
LICS '97 Proceedings of the 12th Annual IEEE Symposium on Logic in Computer Science
A tutorial on the universality and expressiveness of fold
Journal of Functional Programming
Three algorithms on Braun trees
Journal of Functional Programming
Metamorphisms: Streaming representation-changers
Science of Computer Programming
Recursive coalgebras from comonads
Information and Computation - Special issue: Seventh workshop on coalgebraic methods in computer science 2004
Proceedings of the 6th ACM SIGPLAN workshop on Generic programming
Proving the unique fixed-point principle correct: an adventure with category theory
Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
IFL'10 Proceedings of the 22nd international conference on Implementation and application of functional languages
Hi-index | 0.00 |
Sorting algorithms are an intrinsic part of functional programming folklore as they exemplify algorithm design using folds and unfolds. This has given rise to an informal notion of duality among sorting algorithms: insertion sorts are dual to selection sorts. Using bialgebras and distributive laws, we formalise this notion within a categorical setting. We use types as a guiding force in exposing the recursive structure of bubble, insertion, selection, quick, tree, and heap sorts. Moreover, we show how to distill the computational essence of these algorithms down to one-step operations that are expressed as natural transformations. From this vantage point, the duality is clear, and one side of the algorithmic coin will neatly lead us to the other "for free". As an optimisation, the approach is also extended to paramorphisms and apomorphisms, which allow for more efficient implementations of these algorithms than the corresponding folds and unfolds.