Skip to main content

Unifying Structured Recursion Schemes

Ralf Hinze‚ Nicolas Wu and Jeremy Gibbons

Abstract

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.

Address
New York‚ NY‚ USA
Book Title
Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming
Editor
Uustalu‚ Tarmo
Location
Boston‚ Massachusetts‚ USA
Pages
209–220
Publisher
ACM
Series
ICFP '13
Year
2013