Typing References by Effect Inference

Hindley/Milner-style polymorphism is a simple, natural, and flexible type discipline for functional languages, but incorporating imperative extensions is difficult. We present a new technique for typing references in the presence of polymorphism by inferring a concise summary of each expression's allocation behavior—a type effect. A simple technique for proving soundness with respect to a reduction semantics demonstrates that the type system prevents type errors. By establishing that the system corresponds to an alternate system better suited to implementation, we obtain an algorithm to perform type and effect inference.

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

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

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

[4]  Luís Damas Type assignment in programming languages , 1984 .

[5]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[6]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential Control , 1987, Theor. Comput. Sci..

[7]  David K. Gifford,et al.  Polymorphic effect systems , 1988, POPL '88.

[8]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential State , 1989, Theor. Comput. Sci..

[9]  Alain Deutsch,et al.  On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications , 1989, POPL '90.

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

[11]  Robin Milner,et al.  Commentary on standard ML , 1990 .

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

[13]  Xavier Leroy,et al.  Polymorphic type inference and assignment , 1991, POPL '91.

[14]  Pierre Jouvelot,et al.  Algebraic reconstruction of types and effects , 1991, POPL '91.

[15]  James W. O'Toole Type Abstraction Rules for References: A Comparison of Four which have Achieved Notoriety , 1991 .

[16]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[17]  Pierre Jouvelot,et al.  The type and effect discipline , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.