skip to main content
research-article

Unifying structured recursion schemes

Published:25 September 2013Publication History
Skip Abstract Section

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.

References

  1. R. Backhouse, M. Bijsterveld, R. van Geldrop, and J. van der Woude, "Categorical fixed point calculus," in CTCS, ser. LNCS, vol. 953. Springer, 1995, pp. 159--179. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. F. Bartels, "Generalised coinduction," Mathematical Structures in Computer Science, vol. 13, pp. 321--348, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Bird and O. de Moor, Algebra of Programming. London: Prentice Hall, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Bird and R. Paterson, "Generalised folds for nested datatypes," Formal Aspects of Computing, vol. 11, no. 2, pp. 200--222, 1999.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. V. Capretta, T. Uustalu, and V. Vene, "Recursive coalgebras from comonads," Information and Computation, vol. 204, no. 4, pp. 437--468, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Eilenberg and J. C. Moore, "Adjoint functors and triples," Illinois J. Math, vol. 9, no. 3, pp. 381--398, 1965.Google ScholarGoogle ScholarCross RefCross Ref
  7. M. M. Fokkinga, "Law and order in algorithmics," Ph.D. dissertation, University of Twente, Feb. 1992.Google ScholarGoogle Scholar
  8. ----, "Tupling and mutumorphisms," The Squiggolist, vol. 1, no. 4, pp. 81--82, Jun. 1990.Google ScholarGoogle Scholar
  9. J. Gibbons, "Generic downwards accumulations," Science of Computer Programming, vol. 37, no. 1--3, pp. 37--65, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. Hagino, "Category theoretic approach to data types," Ph.D. dissertation, University of Edinburgh, 1987.Google ScholarGoogle Scholar
  11. R. Hinze, "Adjoint folds and unfolds--an extended study," Science of Computer Programming, Aug. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Hinze and D. W. James, "Proving the unique fixed-point principle correct: an adventure with category theory," in ICFP. ACM, 2011, pp. 359--371. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. J. Huber, "Homotopy theory in general categories," Math. Ann., vol. 144, pp. 361--385, 1961.Google ScholarGoogle ScholarCross RefCross Ref
  14. D. M. Kan, "Adjoint functors," Trans. AMS, vol. 87, no. 2, pp. 294--329, 1958.Google ScholarGoogle ScholarCross RefCross Ref
  15. H. Kleisli, "Every standard construction is induced by a pair of adjoint functors," Proc. AMS, vol. 16, no. 3, pp. 544--546, Jun. 1965.Google ScholarGoogle Scholar
  16. J. Lambek, "A fixpoint theorem for complete categories," Math. Zeitschr., vol. 103, pp. 151--161, 1968.Google ScholarGoogle ScholarCross RefCross Ref
  17. S. Mac Lane, Categories for the Working Mathematician, 2nd ed., ser. Graduate Texts in Mathematics. Berlin: Springer-Verlag, 1998.Google ScholarGoogle Scholar
  18. G. Malcolm, "Algebraic data types and program transformation," Ph.D. dissertation, University of Groningen, 1990.Google ScholarGoogle Scholar
  19. ----, "Data structures and program transformation," Science of Computer Programming, vol. 14, no. 2-3, pp. 255--280, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Matthes and T. Uustalu, "Substitution in non-wellfounded syntax with variable binding," TCS, vol. 327, no. 1-2, pp. 155--174, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. L. Meertens, "Paramorphisms," Formal Aspects of Computing, vol. 4, pp. 413--424, 1992.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. Meijer, M. Fokkinga, and R. Paterson, "Functional programming with bananas, lenses, envelopes and barbed wire," in FPLCA, ser. LNCS, vol. 523. Springer, 1991, pp. 124--144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. P. Mendler, "Inductive types and type constraints in the second-order lambda calculus," Ann. Pure Appl. Logic, vol. 51, no. 1-2, pp. 159--172, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  24. P. H. Palmquist, "The double category of adjoint squares," in Midwest Category Seminar V, ser. LNM. Springer, 1971, vol. 195, pp. 123--153.Google ScholarGoogle Scholar
  25. A. Pardo, "Generic accumulations," in Working Conference on Generic Programming, vol. 243. Kluwer Academic Publishers, Jul. 2002, pp. 49--78. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Uustalu and V. Vene, "Primitive (co)recursion and course-of-value (co)iteration, categorically," Informatica, Lith. Acad. Sci., vol. 10, no. 1, pp. 5--26, 1999.Google ScholarGoogle Scholar
  27. ----, "Comonadic notions of computation," in CMCS, ser. ENTCS, vol. 203(5), 2008, pp. 263--284. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. ----, "Mendler-style inductive types, categorically," Nordic J. Comput., vol. 6, pp. 343--361, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. ----, "The recursion scheme from the cofree recursive comonad," ENTCS, vol. 229, no. 5, pp. 135--157, 2011, proceedings of the Second Workshop on Mathematically Structured Functional Programming (MSFP 2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. Uustalu, V. Vene, and A. Pardo, "Recursion schemes from comonads," Nordic J. Comput., vol. 8, pp. 366--390, Sep. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. V. Vene and T. Uustalu, "Functional programming with apomorphisms (corecursion)," Proceedings of the Estonian Academy of Sciences: Physics, Mathematics, vol. 47, no. 3, pp. 147--161, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  32. J. C. Vidal and J. S. Tur, "Kleisli and Eilenberg-Moore constructions as parts of biadjoint situations," Extracta Mathematicae, vol. 25, no. 1, pp. 1--61, 2010.Google ScholarGoogle Scholar

Index Terms

  1. Unifying structured recursion schemes

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 9
      ICFP '13
      September 2013
      457 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2544174
      Issue’s Table of Contents
      • cover image ACM Conferences
        ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
        September 2013
        484 pages
        ISBN:9781450323260
        DOI:10.1145/2500365

      Copyright © 2013 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 September 2013

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!