Let should not be generalized

From the dawn of time, all derivatives of the classic Hindley-Milner type system have supported implicit generalisation of local let-bindings. Yet, as we will show, for more sophisticated type systems implicit let-generalisation imposes a disproportionate complexity burden. Moreover, it turns out that the feature is very seldom used, so we propose to eliminate it. The payoff is a substantial simplification, both of the specification of the type system, and of its implementation.

[1]  Mark P. Jones Qualified Types: Theory and Practice , 1994 .

[2]  Peter J. Stuckey,et al.  Type inference for GADTs via Herbrand constraint abduction , 2008 .

[3]  Mark P. Jones,et al.  Type Classes with Functional Dependencies , 2000, ESOP.

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

[5]  Tobias Nipkow,et al.  Type Reconstruction for Type Classes , 1993 .

[6]  Simon Peyton Jones,et al.  Towards open type functions for Haskell , 2007 .

[7]  Simon L. Peyton Jones,et al.  Complete and decidable type inference for GADTs , 2009, ICFP.

[8]  Simon L. Peyton Jones,et al.  Associated type synonyms , 2005, ICFP '05.

[9]  François Pottier,et al.  A constraint-based approach to guarded algebraic data types , 2007, TOPL.

[10]  Gang Chen,et al.  Guarded recursive datatype constructors , 2003, POPL '03.

[11]  Martin Sulzmann,et al.  Hindley/Milner style type systems in constraint form , 1999 .

[12]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

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

[14]  Peter J. Stuckey,et al.  A Framework for Extended Algebraic Data Types , 2006, FLOPS.

[15]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[16]  Andrew Kennedy Type Inference and Equational Theories , 1996 .

[17]  Simon L. Peyton Jones,et al.  Associated types with class , 2005, POPL '05.

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

[19]  Simon L. Peyton Jones,et al.  Sound and Decidable Type Inference for Functional Dependencies , 2004, ESOP.

[20]  Simon L. Peyton Jones,et al.  Type checking with open type functions , 2008, ICFP.

[21]  Daan Leijen,et al.  Helium, for learning Haskell , 2003, Haskell '03.

[22]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[23]  P. Hudak,et al.  A general framework for hindley/milner type systems with constraints , 2000 .

[24]  Simon L. Peyton Jones,et al.  Practical type inference for arbitrary-rank types , 2007, Journal of Functional Programming.

[25]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

[26]  Simon L. Peyton Jones,et al.  Type classes in Haskell , 1994, TOPL.

[27]  Mads Tofte,et al.  Type Inference for Polymorphic References , 1990, Inf. Comput..

[28]  Mark Philip Jones Qualified types: theory and practice (ordering relation) , 1992 .