Abstract
Polymorphism in ML is implicit: type variables are silently introduced and eliminated. The lack of an explicit declaration of type variables restricts the expressiveness of parameterised modules (functors). Certain polymorphic functions cannot be expressed as functors, because implicit type parameters of polymorphic functions are in one respect more powerful than formal type parameters of functors.
The title suggests that this lack of expressiveness is due to a restricted ability to abstract — polymorphism is restricted. Type variables can only be abstracted from value declarations, but not from other forms of declarations, especially not from structure declarations.
The paper shows in the case of Standard ML how (syntax and) semantics can be modified to fill this language gap. This is not so much a question of programming language design as a contribution for better understanding the relationship between polymorphic functions, polymorphic types, and functors.
The research reported here was supported by SERC grant GR/J 07303.
Chapter PDF
Similar content being viewed by others
References
Hendrik P. Barendregt. Lambda calculi with types. In Handbook of Logic in Computer Science, Vol.2, pages 117–309. Oxford Science Publications, 1992.
Roberto di Cosmo. Type isomorphisms in a type-assignment framework. In 19th ACM Symposium on Principles of Programming Languages, pages 200–210, 1992.
Bernd Gersdorf. Entwurf, formale Definition und Implementierung der funktionallogischen Programmiersprache ET. PhD thesis, Universität Bremen, 1992. (mainly in German).
Robert Harper, John C. Mitchell, and Eugenio Moggi. Higher-order modules and the phase distinction. In 17th ACM Symposium on Principles of Programming Languages, pages 341–354, 1990.
Fritz Henglein. Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems, 15(2):253–289, 1993.
Roger Hindley. The principal type-scheme of an object in combinatory logic. Transactions of AMS, 146:29–60, 1969.
Ralf Hinze. Einführung in die funktionale Programmierung mit Miranda. Teubner, 1992. (in German).
Ian Holyer. Functional Programming with Miranda. Pitman, 1991.
P. Hudak, S. Peyton Jones, and P. Wadler. Report on the Programming Language Haskell, a Non-strict, Purely Functional Language. Technical report, University of Glasgow, 1992. (also in SIGPLAN Notices 27(5), May 1992).
Stefan Kahrs. Mistakes and ambiguities in the definition of Standard ML. Technical Report ECS-LFCS-93-257, University of Edinburgh, 1993.
A.J. Kfoury, J. Tiuryn, and P. Urcyczyn. The undecidability of the semi-unification problem. Information and Computation, 102(1):83–101, January 1993.
Xavier Leroy. Polymorphic typing of an algorithmic language. Rapports de Recherche No. 1778, INRIA, 1992.
Per Martin-Löf. An intuitionistic theory of types: predicative part. In Rose and Shepherdson, editors, Logic Colloquium 1973, pages 73–118. North-Holland, 1975.
Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.
Robin Milner and Mads Tofte. Commentary on Standard ML. MIT Press, 1991.
Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.
Laurence C. Paulson. ML for the Working Programmer. Cambridge University Press, 1991.
Stefan Sokolowski. Applicative High Order Programming. Chapman & Hall Computing, 1991.
Philip Wadler. The essence of functional programming. In 19th ACM Symposion on Principles of Programming Languages, pages 1–14, 1992.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kahrs, S. (1994). First-class polymorphism for ML. In: Sannella, D. (eds) Programming Languages and Systems — ESOP '94. ESOP 1994. Lecture Notes in Computer Science, vol 788. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57880-3_22
Download citation
DOI: https://doi.org/10.1007/3-540-57880-3_22
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57880-2
Online ISBN: 978-3-540-48376-2
eBook Packages: Springer Book Archive