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.
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
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.
R. S. Bird and O. de Moor. Algebra of Programming. Prentice-Hall International, 1996.
H. Doornbos and R. Backhouse. Reductivity. Science of Computer Programming, 26(1-3):217–236, 1996.
P. Freyd and A. Scedrov. Categories, Allegories. North-Holland, 1990.
P. Hoogendijk. A Generic Theory of Datatypes. PhD thesis, Department of Mathematics and Computing Science, Eindhoven University of Technology, 1997.
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.
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.
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.
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.
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.
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.
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.
R. Milner. A theory of type polymorphism in programming. J. Comp. Syst. Scs., 17:348–375, 1977.
E. Moggi. Notions of computation and monads. Information and Computation, 93(1):55–92, 1991.
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.
J. Reynolds. Types, abstraction and parametric polymorphism. In R. Mason, editor, IFIP '83, pages 513–523. Elsevier Science Publishers, 1983. *** DIRECT SUPPORT *** A0008C33 00006
Author information
Authors and Affiliations
Editor information
Rights 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