Skip to main content

When Do Datatypes Commute?

  • Conference paper
  • First Online:
Category Theory and Computer Science (CTCS 1997)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1290))

Included in the following conference series:

Abstract

Polytypic programs are programs that are parameterised by type constructors (like List), unlike polymorphic programs which are parameterised by types (like Int). In this paper we formulate precisely the polytypic programming problem of “commuting” two datatypes. The precise formulation involves a notion of higher order naturality. We demonstrate via a number of examples the relevance and interest of the problem, and we show that all “regular datatypes" (tree-like datatypes that one can define in a functional programming language) do indeed commute according to our specification. The framework we use is the theory of allegories, a combination of category theory with the pointfree relation calculus.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. Backhouse, H. Doornbos, and P. Hoogendijk. Commuting relators. Available via World-Wide Web at http://www.win.tue.nl/cs/wp/papers, September 1992.

    Google Scholar 

  2. R. Bird. Lectures on constructive functional programming. In M. Broy, editor, Constructive Methods in Computing Science, pages 151–216. Springer-Verlag, 1989. NATO ASI Series, vol. F55.

    Google Scholar 

  3. R. Bird, O. de Moor, and P. Hoogendijk. Generic functional programming with types and relations. J. of Functional Programming, 6(1):1–28, January 1996.

    Article  MATH  Google Scholar 

  4. R. S. Bird and O. de Moor. Algebra of Programming. Prentice-Hall International, 1996.

    Google Scholar 

  5. H. Doornbos and R. Backhouse. Reductivity. Science of Computer Programming, 26(1-3):217–236, 1996.

    Article  MATH  MathSciNet  Google Scholar 

  6. P. Freyd and A. Scedrov. Categories, Allegories. North-Holland, 1990.

    Google Scholar 

  7. P. Hoogendijk. A Generic Theory of Datatypes. PhD thesis, Department of Mathematics and Computing Science, Eindhoven University of Technology, 1997.

    Google Scholar 

  8. P. Hoogendijk and O. de Moor. What is a datatype? Technical Report 96/16, Department of Mathematics and Computing Science, Eindhoven University of Technology, 1996. Submitted to Science of Computer Programming. Available via World-Wide Web at http://www.win.tue.nl/cs/wp/papers.

    Google Scholar 

  9. J. Jeuring. Polytypic pattern matching. In Conference Record of FPCA '95, SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pages 238–248, 1995.

    Google Scholar 

  10. J. Jeuring and P. Janssen. Polytypic programming. In J. Launchbury, E. Meijer, and T. Sheard, editors, Proceedings of the Second International Summer School on Advanced Functional Programming Techniques, pages 68–114. Springer-Verlag, 1996. LNCS 1129.

    Google Scholar 

  11. A. Jung (Editor). Domains and denotational semantics: History, accomplishments and open problems. Bulletin of the European Association for Computer Science, 59:227–256, June 1996.

    Google Scholar 

  12. G. Malcolm. Homomorphisms and promotability. In J. van de Snepscheut, editor, Conference on the Mathematics of Program Construction, pages 335–347. Springer-Verlag LNCS 375, 1989.

    Google Scholar 

  13. L. Meertens. Calculate polytypically! In H. Kuchen and S. D. Swierstra, editors, Proceedings of the Eighth International Symposium PLILP '96 Programming Languages: Implementations, Logics and Programs, volume 1140 of Lecture Notes in Computer Science, pages 1–16. Springer Verlag, 1996.

    Google Scholar 

  14. E. Meijer, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In FPCA91: Functional Programming Languages and Computer Architecture, volume 523 of LNCS, pages 124–144. Springer-Verlag, 1991.

    Google Scholar 

  15. R. Milner. A theory of type polymorphism in programming. J. Comp. Syst. Scs., 17:348–375, 1977.

    Article  MathSciNet  Google Scholar 

  16. E. Moggi. Notions of computation and monads. Information and Computation, 93(1):55–92, 1991.

    Article  MATH  MathSciNet  Google Scholar 

  17. G. D. Plotkin. Lambda-definability in the full type hierarchy. In J. Seldin and J. Hindley, editors, To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism. Academic Press, London, 1980.

    Google Scholar 

  18. J. Reynolds. Types, abstraction and parametric polymorphism. In R. Mason, editor, IFIP '83, pages 513–523. Elsevier Science Publishers, 1983. *** DIRECT SUPPORT *** A0008C33 00006

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Eugenio Moggi Giuseppe Rosolini

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hoogendijk, P., Backhouse, R. (1997). When Do Datatypes Commute?. In: Moggi, E., Rosolini, G. (eds) Category Theory and Computer Science. CTCS 1997. Lecture Notes in Computer Science, vol 1290. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026992

Download citation

  • DOI: https://doi.org/10.1007/BFb0026992

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-63455-3

  • Online ISBN: 978-3-540-69552-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics