Abstract
A polytypic function definition is a function definition that is parametrised with a datatype. It embraces a class of algorithms. As an example we define a simple polytypic “crush” combinator that can be used to calculate polytypically. The ability to define functions polytypically adds another level of flexibility in the reusability of programming idioms and in the design of libraries of interoperable components.
Preview
Unable to display preview. Download preview PDF.
References
Roland Backhouse, Henk Doornbos and Paul Hoogendijk. A Class of Commuting Relators. Unpublished, Eindhoven University of Technology, 1992. WWW ftp://ftp.win.tue.nl/pub/math.prog.construction/zip.dvi.Z.
Richard S. Bird. An introduction to the theory of lists. In M. Broy, editor, Logic of Programming and Calculi of Discrete Design, volume F36 of NATO ASI Series, pages 5–42. Springer-Verlag, 1987.
Richard Bird and Oege de Moor. Algebra of Programming. To appear, Prentice Hall, 1996.
Richard Bird, Oege de Moor and Paul Hoogendijk. Generic functional programming with types and relations. J. of Functional Programming, 6(1):1–28, 1996.
Oege de Moor. A Generic Program for Sequential Decision Processes. In Manuel Hermenegildo and S. Doaitse Swierstra, editors, PLILP'95: Programming Languages: Implementations, Logics and Programs, volume 982 of LNCS, pages 1–23. Springer Verlag, 1995.
Leonidas Fegaras and Tim Sheard. Revisiting catamorphisms over datatypes with embedded functions. In Proceedings Principles of Programming Languages, POPL '96, 1996.
Maarten M. Fokkinga. Law and Order in Algorithmics. PhD thesis, University of Twente, Dept INF, Enschede, The Netherlands, 1992.
Maarten M. Fokkinga. Calculate categorically! Formal Aspects of Computing, 4(4):673–692, 1992.
Maarten M. Fokkinga. A gentle introduction to category theory — the calculational approach. In Lecture Notes of the STOP 1992 Summerschool on Constructive Algorithmics, pages 1–72 of Part 1. Utrecht University, 1992.
Maarten M. Fokkinga. Monadic maps and folds for arbitrary datatypes. Memoranda Informatica 94–28, University of Twente, 1994.
Maarten M. Fokkinga. Datatype laws without signatures. Mathematical Structures in Computer Science, 6:1–32, 1996.
Peter Freyd. Recursive types reduced to inductive types. In Proceedings Logic in Computer Science, LICS '90, pages 498–507, 1990.
Tatsuya Hagino. Category Theoretic Approach to Data Types. PhD thesis, University of Edinburgh, 1987.
Paul F. Hoogendijk. Generators, Destructors and Natural Transformations. Unpublished, Eindhoven University of Technology, 1993. WwW ftp://ftp.win.tue.nl/pub/math.prog.construction/gendes.dvi.Z.
John Hughes. The Design of a Pretty-printing Library. In Johan Jeuring and Erik Meijer, editors, Advanced Functional Programming, LNCS 925, pages 53–96. Springer Verlag, 1995.
Marieke Huisman. The Calculation of a Polytypic Parser. Master's thesis, Utrecht University, Dept. of Computing Science, 1996.
Patrik Jansson. Polytypism and Polytypic Unification. Master's thesis, Chalmers University of Technology and University of Göteborg, 1995. WwW file://ftp.cs.chalmers.se/pub/users/patrikj/papers/masters/thesis.ps.Z.
Patrik Jansson and Johan Jeuring. Polyp — a polytypic programming language. Submitted for publication, 1996. WWW http://www.cs.chalmers.se/∼johanj/polytypism/polyp.ps.
Patrik Jansson and Johan Jeuring. Polytypic unification — implementing polytypic functions with constructor classes. Submitted for publication, 1996. WwW http://www.cs.chalmers.se/johanj/polytypism/unify.ps.
Patrik Jansson and Johan Jeuring. Type inference for polytypic functions. In preparation, 1996.
Johan Jeuring. Polytypic pattern matching. In S. Peyton Jones, editor, Conference Record of FPCA '95, SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pages 238–248, 1995. WwW http://www.cs.chalmers.se/∼johanj/ppm.dvi.
Johan Jeuring and Patrik Jansson. Polytypic programming. To appear in Proceedings of the Second International Summer School on Advanced Functional Programming Techniques, LNCS, Springer Verlag, 1996. WwW http://www.cs.chalmers.se/∼johanj/polytypism/notes.ps.
Mark P. Jones. Functional Programming with Overloading and Higher-Order Polymorphism. In Johan Jeuring and Erik Meijer, editors, Advanced Functional Programming, LNCS 925, pages 97–136. Springer Verlag, 1995.
Grant Malcolm. Homomorphisms and promotability. In J.L.A. van de Snepscheut, editor, Mathematics of Program Construction, LNCS 375, pages 335–347. Springer Verlag, 1989.
Grant Malcolm. Algebraic Data Types and Program Transformation. PhD thesis, University of Groningen, 1990.
Grant Malcolm. Data structures and program transformation. Science of Computer Programming, 14(2–3):255–280, 1990.
Ernest G. Manes and Michael A. Arbib. Algebraic Approaches to Program Semantics. Text and Monographs in Computer Science. Springer Verlag, 1986.
Lambert Meertens. Algorithmics—towards programming as a mathematical activity. In J.W. de Bakker, M. Hazewinkel, and J.K. Lenstra, editors, Proceedings of the CWI Symposium on Mathematics and Computer Science, volume 1 of CWI Monographs, pages 289–334. North-Holland, 1986.
Lambert Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413–425, 1992.
Lambert Meertens. Category Theory for Program Construction by Calculation. Lecture Notes for ESSLLI'95, 1995. WWW http://www.cwi.nl/∼lambert/e95.ps.Z.
Erik Meijer, Maarten M. Fokkinga and Ross Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In FPCA91: Functional Programming Languages and Computer Architecture, LNCS 523, pages 124–144. Springer Verlag, 1991.
Erik Meijer and Graham Hutton. Bananas in space: extending fold and unfold to exponential types. In S. Peyton Jones, editor, Conference Record of FPCA '95, SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pages 324–333, 1995.
Fritz Ruehr. Analytical and Structural Polymorphism Expressed Using Patterns Over Types. PhD thesis, University of Michigan, 1992.
Tim Sheard. Type parametric programming with compile-time reflection. Oregon Graduate Institute of Science and Technology, 1993.
Tim Sheard and Leonidas Fegaras. A Fold for All Seasons. In FPCA '93, Conference on Functional Programming Languages and Computer Architecture, pages 233–242. ACM Press, 1993. WwW ftp://cse.ogi.edu/pub/crml/fpca93.ps.Z.
Daniël Tuijnman. A Categorical Approach to Functional Programming. PhD thesis, Universität Ulm, Fakultät für Informatik, Abteilung Programmiermethodik und Compilerbau, 1995.
Phil Wadler. Theorems for free! In Functional Programming Languages and Computer Architecture, FPCA '89, pages 347–359. ACM Press, 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Meertens, L. (1996). Calculate polytypically!. In: Kuchen, H., Doaitse Swierstra, S. (eds) Programming Languages: Implementations, Logics, and Programs. PLILP 1996. Lecture Notes in Computer Science, vol 1140. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61756-6_73
Download citation
DOI: https://doi.org/10.1007/3-540-61756-6_73
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61756-3
Online ISBN: 978-3-540-70654-0
eBook Packages: Springer Book Archive