Skip to main content

Calculate polytypically!

  • Invited Talk
  • Conference paper
  • First Online:
Programming Languages: Implementations, Logics, and Programs (PLILP 1996)

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

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.

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. 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.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. Richard Bird and Oege de Moor. Algebra of Programming. To appear, Prentice Hall, 1996.

    Google Scholar 

  4. Richard Bird, Oege de Moor and Paul Hoogendijk. Generic functional programming with types and relations. J. of Functional Programming, 6(1):1–28, 1996.

    Google Scholar 

  5. 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.

    Google Scholar 

  6. Leonidas Fegaras and Tim Sheard. Revisiting catamorphisms over datatypes with embedded functions. In Proceedings Principles of Programming Languages, POPL '96, 1996.

    Google Scholar 

  7. Maarten M. Fokkinga. Law and Order in Algorithmics. PhD thesis, University of Twente, Dept INF, Enschede, The Netherlands, 1992.

    Google Scholar 

  8. Maarten M. Fokkinga. Calculate categorically! Formal Aspects of Computing, 4(4):673–692, 1992.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. Maarten M. Fokkinga. Monadic maps and folds for arbitrary datatypes. Memoranda Informatica 94–28, University of Twente, 1994.

    Google Scholar 

  11. Maarten M. Fokkinga. Datatype laws without signatures. Mathematical Structures in Computer Science, 6:1–32, 1996.

    Google Scholar 

  12. Peter Freyd. Recursive types reduced to inductive types. In Proceedings Logic in Computer Science, LICS '90, pages 498–507, 1990.

    Google Scholar 

  13. Tatsuya Hagino. Category Theoretic Approach to Data Types. PhD thesis, University of Edinburgh, 1987.

    Google Scholar 

  14. 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.

    Google Scholar 

  15. 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.

    Google Scholar 

  16. Marieke Huisman. The Calculation of a Polytypic Parser. Master's thesis, Utrecht University, Dept. of Computing Science, 1996.

    Google Scholar 

  17. 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.

    Google Scholar 

  18. Patrik Jansson and Johan Jeuring. Polyp — a polytypic programming language. Submitted for publication, 1996. WWW http://www.cs.chalmers.se/∼johanj/polytypism/polyp.ps.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. Patrik Jansson and Johan Jeuring. Type inference for polytypic functions. In preparation, 1996.

    Google Scholar 

  21. 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.

    Google Scholar 

  22. 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.

    Google Scholar 

  23. 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.

    Google Scholar 

  24. 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.

    Google Scholar 

  25. Grant Malcolm. Algebraic Data Types and Program Transformation. PhD thesis, University of Groningen, 1990.

    Google Scholar 

  26. Grant Malcolm. Data structures and program transformation. Science of Computer Programming, 14(2–3):255–280, 1990.

    Google Scholar 

  27. Ernest G. Manes and Michael A. Arbib. Algebraic Approaches to Program Semantics. Text and Monographs in Computer Science. Springer Verlag, 1986.

    Google Scholar 

  28. 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.

    Google Scholar 

  29. Lambert Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413–425, 1992.

    Google Scholar 

  30. Lambert Meertens. Category Theory for Program Construction by Calculation. Lecture Notes for ESSLLI'95, 1995. WWW http://www.cwi.nl/∼lambert/e95.ps.Z.

    Google Scholar 

  31. 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.

    Google Scholar 

  32. 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.

    Google Scholar 

  33. Fritz Ruehr. Analytical and Structural Polymorphism Expressed Using Patterns Over Types. PhD thesis, University of Michigan, 1992.

    Google Scholar 

  34. Tim Sheard. Type parametric programming with compile-time reflection. Oregon Graduate Institute of Science and Technology, 1993.

    Google Scholar 

  35. 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.

    Google Scholar 

  36. Daniël Tuijnman. A Categorical Approach to Functional Programming. PhD thesis, Universität Ulm, Fakultät für Informatik, Abteilung Programmiermethodik und Compilerbau, 1995.

    Google Scholar 

  37. Phil Wadler. Theorems for free! In Functional Programming Languages and Computer Architecture, FPCA '89, pages 347–359. ACM Press, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Herbert Kuchen S. Doaitse Swierstra

Rights and permissions

Reprints 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

Publish with us

Policies and ethics