First-class polymorphism with type inference

Languages like ML and Haskell encourage the view of values as first-class entities that can be passed as arguments or results of functions, or stored as components of data structures. The same languages offer parametric polymorphism, which allows the use of values that behave uniformly over a range of different types. But the combination of these features is not supported-- polymorphic values are not first-class. This restriction is sometimes attributed to the dependence of such languages on type inference, in contrast to more expressive, explicitly typed languages, like System F, that do support first-class polymorphism.This paper uses relationships between types and logic to develop a type system, FCP, that supports first-class polymorphism, type inference, and also first-class abstract datatypes. The immediate result is a more expressive language, but there are also long term implications for language design.

[1]  Konstantin Läufer Type Classes with Existential Types , 1996, J. Funct. Program..

[2]  Simon L. Peyton Jones,et al.  A short cut to deforestation , 1993, FPCA '93.

[3]  Mark P. Jones,et al.  A system of constructor classes: overloading and implicit higher-order polymorphism , 1993, FPCA '93.

[4]  J. B. Wells Typability and type checking in the second-order Λ-calculus are equivalent and undecidable (Preliminary Draft) , 1993 .

[5]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[6]  J. B. Wells,et al.  Typability and type checking in the second-order /spl lambda/-calculus are equivalent and undecidable , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[7]  J. Girard Une Extension De ĽInterpretation De Gödel a ĽAnalyse, Et Son Application a ĽElimination Des Coupures Dans ĽAnalyse Et La Theorie Des Types , 1971 .

[8]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[9]  Guy L. Steele,et al.  Building interpreters by composing monads , 1994, POPL '94.

[10]  Simon L. Peyton Jones,et al.  The Glasgow Haskell Compiler: A Retrospective , 1992, Functional Programming.

[11]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[12]  Frank Pfenning,et al.  On the Undecidability of Partial Polymorphic Type Reconstruction , 1993, Fundam. Informaticae.

[13]  Mark P. Jones,et al.  The implementation of the Gofer functional programming system , 1994 .

[14]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[15]  Didier Rémy,et al.  Programming Objects with ML-ART, an Extension to ML with Abstract and Record Types , 1994, TACS.

[16]  Paul Hudak,et al.  Monad transformers and modular interpreters , 1995, POPL '95.

[17]  Erik Meijer,et al.  On the expressive power of Constructor Classes , 1994, Functional Programming.

[18]  Simon L. Peyton Jones,et al.  Lazy functional state threads , 1994, PLDI '94.

[19]  Hans-Juergen Boehm Partial Polymorphic Type Inference Is Undecidable , 1985, FOCS.

[20]  John C. Mitchell,et al.  Abstract types have existential types , 1985, POPL.

[21]  Robin Milner,et al.  Definition of standard ML , 1990 .

[22]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[23]  Philip Wadler,et al.  The essence of functional programming (Invited talk) , 1997 .

[24]  Martin Odersky,et al.  Polymorphic type inference and abstract data types , 1994, TOPL.

[25]  Stefan Kaes,et al.  Parametric Overloading in Polymorphic Programming Languages , 1988, ESOP.

[26]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[27]  Martin Odersky,et al.  Putting type annotations to work , 1996, POPL '96.

[28]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[29]  William A. Howard,et al.  The formulae-as-types notion of construction , 1969 .

[30]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[31]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[32]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[33]  WadlerPhilip,et al.  Report on the programming language Haskell , 1992 .