Type checking higher-order polymorphic multi-methods

We present a new predicative and decidable type system, called ML¿, suitable for languages that integrate functional programming and parametric polymorphism in the tradition of ML [21, 28], and class-based object-oriented programming and higher-order multimethods in the tradition of CLOS [12]. Instead of using extensible records as a foundation for object-oriented extensions of functional languages, we propose to reinterpret ML datatype declarations as abstract and concrete class declarations, and to replace pattern matching on run-time values by dynamic dispatch on run-time types. ML¿ is based on universally quantified polymorphic constrained types. Constraints are conjunctions of inequalities between monotypes built from type constructors organized into extensible and partially ordered classes. We give type checking rules for a small, explicitly typed functional language à la XML [20] with multi-methods, show that the resulting system has decidable minimal types, and discuss subject reduction. Finally, we propose a new object-oriented programming language based on the ML¿ type system.

[1]  John C. Mitchell,et al.  Algorithmic aspects of type inference with subtypes , 1992, POPL '92.

[2]  J. Davenport Editor , 1960 .

[3]  Linda G. DeMichiel,et al.  The Common Lisp Object System: An Overview , 1987, ECOOP.

[4]  John H. Reppy,et al.  Classes in Object ML via Modules , 1996 .

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

[6]  Giuseppe Castagna,et al.  A calculus for overloaded functions with subtyping , 1992, LFP '92.

[7]  J. Palsberg Eecient Inference of Object Types , 1995 .

[8]  Jens Palsberg,et al.  Efficient inference of object types , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[9]  Prateek Mishra,et al.  Polymorphic Subtype Inference: Closing the Theory-Practice Gap , 1989, TAPSOFT, Vol.2.

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

[11]  Martin Odersky,et al.  A second look at overloading , 1995, FPCA '95.

[12]  Luca Cardelli,et al.  On Binary Methods , 1995, Theory Pract. Object Syst..

[13]  Stephan Merz,et al.  Primitive Subtyping ^ Implicit Polymorphism J = Object-orientation Extended Abstract , 1996 .

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

[15]  Giorgio Ghelli,et al.  Coherence of Subsumption , 1990, CAAP.

[16]  Scott F. Smith,et al.  Subtyping Constrained Types , 1996, SAS.

[17]  Jerzy Tiuryn,et al.  Satissability of Inequalities in a Poset , .

[18]  John H. Reppy,et al.  Simple objects for Standard ML , 1996, PLDI '96.

[19]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[20]  Thomas Letschert,et al.  Type Inference in the Presence of Overloading, Polymorphism and Coercions , 1984, Fachtagung über Programmiersprachen.

[21]  Stefan Kaes Type inference in the presence of overloading, subtyping and recursive types , 1992, LFP '92.

[22]  Jerzy Tiuryn,et al.  Satisfiability of Inequalities in a Poset , 1996, Fundam. Informaticae.

[23]  Gary T. Leavens,et al.  Typechecking and modules for multi-methods , 1994, OOPSLA '94.

[24]  Xavier Leroy,et al.  Dynamics in ML , 1991, Journal of Functional Programming.

[25]  John C. Mitchell,et al.  Coercion and type inference , 1984, POPL.

[26]  Scott F. Smith,et al.  Sound polymorphic type inference for objects , 1995, OOPSLA.

[27]  Kim B. Bruce,et al.  PolyTOIL: A Type-Safe Polymorphic Object-Oriented Language , 1995, ECOOP.

[28]  Giorgio Ghelli,et al.  Coherence of Subsumption, Minimum Typing and Type-Checking in F<= , 1992, Math. Struct. Comput. Sci..

[29]  Jerzy Tiuryn Subtype inequalities , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[30]  Martín Abadi,et al.  A Theory of Primitive Objects: Second-Order Systems , 1995, Sci. Comput. Program..

[31]  Giuseppe Castagna,et al.  Corrigendum: decidable bounded quantification , 1995, POPL '95.

[32]  Jerzy Tiuryn,et al.  Type Reconstruction with Recursive Types and Atomic Subtyping , 1993, TAPSOFT.

[33]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.

[34]  John C. Mitchell,et al.  Type inference with simple subtypes , 1991, Journal of Functional Programming.

[35]  John C. Mitchell,et al.  On the type structure of standard ML , 1993, TOPL.

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

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

[38]  Jean Vuillemin,et al.  On Circuits and Numbers , 1994, IEEE Trans. Computers.

[39]  Ryan Stansifer,et al.  Type inference with subtypes , 1988, POPL '88.

[40]  John C. Mitchell,et al.  Type Inference with Extended Pattern Matching and Subtypes , 1993, Fundamenta Informaticae.

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