Hostname: page-component-78c5997874-4rdpn Total loading time: 0 Render date: 2024-11-17T14:30:14.675Z Has data issue: false hasContentIssue false

Unifying structured recursion schemes

An Extended Study

Published online by Cambridge University Press:  03 February 2016

RALF HINZE
Affiliation:
Department of Computer Science, University of Oxford, Oxford, UK (e-mail: ralf.hinze@cs.ox.ac.uk)
NICOLAS WU
Affiliation:
Department of Computer Science, University of Bristol, Bristol, UK (e-mail: nicolas.wu@bristol.ac.uk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Folds and unfolds have been understood as fundamental building blocks for total programming, and have been extended to form an entire zoo of specialised structured recursion schemes. A great number of these schemes were unified by the introduction of adjoint folds, but more exotic beasts such as recursion schemes from comonads proved to be elusive. In this paper, we show how the two canonical derivations of adjunctions from (co)monads yield recursion schemes of significant computational importance: monadic catamorphisms come from the Kleisli construction, and more astonishingly, the elusive recursion schemes from comonads come from the Eilenberg–Moore construction. Thus, we demonstrate that adjoint folds are more unifying than previously believed.

Type
Articles
Copyright
Copyright © Cambridge University Press 2016 

References

Backhouse, R., Bijsterveld, M., van Geldrop, R. & van der Woude, J. (1995) Categorical fixed point calculus. In Category Theory and Computer Science: 6th International Conference, CTCS '95, Pitt, D., Rydeheard, D. E. & Johnstone, P. (eds), Lecture Notes in Computer Science, vol. 953. Berlin: Springer, pp. 159179.Google Scholar
Bartels, F. (2003) Generalised coinduction. Math. Struct. Comput. Sci. 13 (4), 321348.Google Scholar
Beck, J. (1969) Distributive laws. In Seminar on Triples and Categorical Homology Theory, Eckmann, B. (ed), Lecture Notes in Mathematics vol. 80. Berlin: Springer, pp. 119140.Google Scholar
Bird, R. & de Moor, O. (1997) Algebra of Programming. NJ: Prentice Hall.Google Scholar
Bird, R. & Paterson, R. (1999) Generalised folds for nested datatypes. Form. Asp. Comput. 11 (2), 200222.Google Scholar
Capretta, V., Uustalu, T. & Vene, V. (2006) Recursive coalgebras from comonads. Inform. Comput. 204 (4), 437468.Google Scholar
Climent, J. & Soliveres, J. (2010) Kleisli and Eilenberg-Moore constructions as parts of biadjoint situations. Extracta Math. 25 (1), 161.Google Scholar
Eilenberg, S. & Moore, J. C. (1965) Adjoint functors and triples. Illinois J. Math. 9 (3), 381398.CrossRefGoogle Scholar
Fokkinga, M. (1990) Tupling and mutumorphisms. The Squiggolist 1 (4), 8182.Google Scholar
Fokkinga, M. (1992) Law and Order in Algorithmics. PhD thesis, the Netherlands: University of Twente.Google Scholar
Fokkinga, M. (1994) Monadic Maps and Folds for Arbitrary Datatypes. Memoranda Informatica 94-28. the Netherlands: Department of Computer Science, University of Twente.Google Scholar
Gibbons, J. (2000) Generic downwards accumulations. Sci. Comput. Program. 37 (1–3), 3765.Google Scholar
Hagino, T. (1987) Category Theoretic Approach to Data Types. PhD thesis, UK: University of Edinburgh.Google Scholar
Hinze, R. (2013) Adjoint folds and unfolds—an extended study. Sci. Comput. Program. 78 (11), 21082159.Google Scholar
Hinze, R. & James, D. W. (2011) Proving the unique fixed-point principle correct: An adventure with category theory. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming, ICFP '11. New York: ACM, pp. 359371.Google Scholar
Hinze, R. & Wu, N. (2011) Towards a categorical foundation for generic programming. In Proceedings of the 7th ACM SIGPLAN Workshop on Generic Programming, WGP '11. New York: ACM, pp. 4758.Google Scholar
Hinze, R. & Wu, N. (2013) Histo- and dynamorphisms revisited. In Proceedings of the 9th ACM SIGPLAN Workshop on Generic Programming, WGP '13. New York: ACM, pp. 112.Google Scholar
Hinze, R., Wu, N. & Gibbons, J. (2013) Unifying structured recursion schemes. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP '13. New York: ACM, pp. 209220.Google Scholar
Hinze, R., Wu, N. & Gibbons, J. (2015) Conjugate hylomorphisms – or: The mother of all structured recursion schemes. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '15. New York: ACM, pp. 527538.Google Scholar
Huber, P. J. (1961) Homotopy theory in general categories. Math. Ann. 144 (5), 361385.Google Scholar
Kan, D. M. (1958) Adjoint functors. Trans. Am. Math. Soc. 87 (2), 294329.Google Scholar
Kleisli, H. (1965) Every standard construction is induced by a pair of adjoint functors. Proc. Am. Math. Soc. 16 (3), 544546.Google Scholar
Lambek, J. (1968) A fixpoint theorem for complete categories. Math. Z. 103 (2), 151161.Google Scholar
Mac Lane, S. (1998) Categories for the Working Mathematician. 2nd ed. Graduate Texts in Mathematics, vol. 5. Berlin: Springer.Google Scholar
Malcolm, G. (1990a) Algebraic Data Types and Program Transformation. PhD thesis, the Netherlands: University of Groningen.Google Scholar
Malcolm, G. (1990b) Data structures and program transformation. Sci. Comput. Program. 14 (2–3), 255280.Google Scholar
Matthes, R. & Uustalu, T. (2004) Substitution in non-wellfounded syntax with variable binding. Theor. Comput. Sci. 327 (1–2), 155174.Google Scholar
Meertens, L. (1992) Paramorphisms. Form. Asp. Comput. 4 (5), 413424.Google Scholar
Meijer, E., Fokkinga, M. & Paterson, R. (1991) Functional programming with bananas, lenses, envelopes and barbed wire. In Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture, FPCA'91, Hughes, J. (ed), Lecture Notes in Computer Science, vol. 523. Berlin: Springer, pp. 124144.Google Scholar
Mendler, N. P. (1991) Inductive types and type constraints in the second-order lambda calculus. Ann. Pure Appl. Log. 51 (1–2), 159172.Google Scholar
Palmquist, P. H. (1971) The double category of adjoint squares. Reports of the Midwest Category Seminar V, Gray, J. (ed), Lecture Notes in Mathematics, vol. 195. Berlin: Springer, pp. 123153.Google Scholar
Pardo, A. (2002) Generic accumulations. In Generic Programming: IFIP TC2/WG2.1 Working Conference on Generic Programming, Gibbons, J. & Jeuring, J. (eds), International Federation for Information Processing, vol. 115. Dordrecht: Kluwer Academic Publishers, pp. 4978.Google Scholar
Turi, D. & Plotkin, G. (1997) Towards a mathematical operational semantics. In Proceedings of the 12th Annual IEEE Symposium on Logic in Computer Science, LICS '97. IEEE Computer Society Press, U.S., pp. 280291.Google Scholar
Uustalu, T. & Vene, V. (1999a) Mendler-style inductive types, categorically. Nord. J. Comput. 6 (3), 343361.Google Scholar
Uustalu, T. & Vene, V. (1999b) Primitive (co)recursion and course-of-value (co)iteration, categorically. Informatica 10 (1), 526.Google Scholar
Uustalu, T. & Vene, V. (2008) Comonadic notions of computation. Electron. Notes Theor. Comput. Sci. 203 (5), 263284.Google Scholar
Uustalu, T. & Vene, V. (2011) The recursion scheme from the cofree recursive comonad. Electron. Notes Theor. Comput. Sci. 229 (5), 135157.Google Scholar
Uustalu, T., Vene, V. & Pardo, A. (2001) Recursion schemes from comonads. Nord. J. Comput. 8 (3), 366390.Google Scholar
Vene, V. & Uustalu, T. (1998) Functional programming with apomorphisms (corecursion). Proc. Est. Acad. Sci.: Phys. Math. 47 (3), 147161.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.