Unifying Structured Recursion Schemes
by Ralf Hinze, Nicolas Wu, and Jeremy Gibbons
Presented by Nicolas Wu at ICFP 2013
Author's revised version of the paper:
Folds over inductive datatypes are well understood and widely used. In their plain form, they are quite restricted; but many disparate generalisations have been proposed that enjoy similar calculational benefits. There have also been attempts to unify the various generalisations: two prominent such unifications are the "recursion schemes from comonads" of Uustalu, Vene and Pardo, and our own "adjoint folds". Until now, these two unified schemes have appeared incompatible. We show that this appearance is illusory: in fact, adjoint folds subsume recursion schemes from comonads. The proof of this claim involves standard constructions in category theory that are nevertheless not well known in functional programming: Eilenberg-Moore categories and bialgebras. The link between the two schemes is provided by the fusion rule of categorical fixed-point calculus.