Colored local type inference

We present a type system for a language based on F≤, which allows certain type annotations to be elided in actual programs. Local type inference determines types by a combination of type propagation and local constraint solving, rather than by global constraint solving. We re ne the previously existing local type inference system of Pierce and Turner[PT98] by allowing partial type information to be propagated. This is expressed by coloring types to indicate propagation directions. Propagating partial type information allows us to omit type annotations for the visitor pattern, the analogue of pattern matching in languages without sum types.

[1]  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.

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

[3]  Luca Cardelli,et al.  Modula-3 language definition , 1992, SIGP.

[4]  OderskyMartin,et al.  Colored local type inference , 2001 .

[5]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[6]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[7]  Cédric Fournet,et al.  The reflexive CHAM and the join-calculus , 1996, POPL '96.

[8]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[9]  Magnus Carlsson,et al.  Reactive objects in a functional language : an escape from the Evil I , 1997, ICFP 1997.

[10]  François Pottier,et al.  A framework for type inference with subtyping , 1998, ICFP '98.

[11]  Didier Rémy,et al.  Semi-Explicit First-Class Polymorphism for ML , 1999, Inf. Comput..

[12]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[13]  Frank Pfenning,et al.  Partial polymorphic type inference and higher-order unification , 1988, LISP and Functional Programming.

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

[15]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[16]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[17]  François Pottier,et al.  Simplifying subtyping constraints , 1996, ICFP '96.

[18]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[19]  Martin Odersky,et al.  Functional Nets , 2000, ESOP.

[20]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[21]  Martin Odersky,et al.  Colored Local Type Inference (colored version) (black and white version) , 2001 .

[22]  Joyce L. Vedral,et al.  Functional Programming Languages and Computer Architecture , 1989, Lecture Notes in Computer Science.

[23]  Bjarne Stroustrup,et al.  The C++ Programming Language, Second Edition , 1991 .

[24]  Scott F. Smith,et al.  Type inference for recursively constrained types and its application to OOP , 1995, MFPS.

[25]  Luca Cardelli An implementation of F , 1993 .

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

[27]  Johan Nordlander,et al.  Pragmatic subtyping in polymorphic languages , 1998, ICFP '98.

[28]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[29]  Didier Rémy,et al.  Type checking records and variants in a natural extension of ML , 1989, POPL '89.

[30]  Mark P. Jones,et al.  First-class polymorphism with type inference , 1997, POPL '97.

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

[32]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[33]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[34]  V. Litvinov Constraint-based polymorphism in Cecil: towards a practical and static type system , 1998, OOPSLA Addendum.

[35]  Simon Peyton Jones,et al.  Simple Usage Polymorphism , 2000 .