Results 1 
5 of
5
Type Inference with Polymorphic Recursion
 Transactions on Programming Languages and Systems
, 1991
"... The DamasMilner Calculus is the typed Acalculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Mirandal and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing rule. H ..."
Abstract

Cited by 135 (0 self)
 Add to MetaCart
The DamasMilner Calculus is the typed Acalculus underlying the type system for ML and several other strongly typed polymorphic functional languages such as Mirandal and Haskell. Mycroft has extended its problematic monomorphic typing rule for recursive definitions with a polymorphic typing rule. He proved the resulting type system, which we call the MilnerMycroft Calculus, sound with respect to Milner’s semantics, and showed that it preserves the principal typing property of the DamasMilner Calculus. The extension is of practical significance in typed logic programming languages and, more generally, in any language with (mutually) recursive definitions. In this paper we show that the type inference problem for the MilnerMycroft Calculus is logspace equivalent to semiunification, the problem of solving subsumption inequations between firstorder terms. This result has been proved independently by Kfoury et al. In connection with the recently established undecidability of semiunification this implies that typability in the MilnerMycroft Calculus is undecidable. We present some reasons why type inference with polymorphic recursion appears to be practical despite its undecidability. This also sheds some light on the observed practicality of ML
Type inference and semiunification
 In Proceedings of the ACM Conference on LISP and Functional Programming (LFP ) (Snowbird
, 1988
"... In the last ten years declarationfree programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically type ..."
Abstract

Cited by 25 (6 self)
 Add to MetaCart
In the last ten years declarationfree programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically typed languages (Algol68, Pascal). These polymorphic languages can be type checked at compile time, yet allow functions whose arguments range over a variety of types. We investigate several polymorphic type systems, the most powerful of which, termed MilnerMycroft Calculus, extends the socalled letpolymorphism found in, e.g., ML with a polymorphic typing rule for recursive definitions. We show that semiunification, the problem of solving inequalities over firstorder terms, characterizes type checking in the MilnerMycroft Calculus to polynomial time, even in the restricted case where nested definitions are disallowed. This permits us to extend some infeasibility results for related combinatorial problems to type inference and to correct several claims and statements in the literature. We prove the existence of unique most general solutions of term inequalities, called most general semiunifiers, and present an algorithm for computing them that terminates for all known inputs due to a novel “extended occurs check”. We conjecture this algorithm to be
Rank2 Intersection and Polymorphic Recursion
 In TLCA’05, volume 2841 of LNCS
, 2005
"... Let # be a rank2 intersection type system. We say that a term is #simple (or just simple when the system # is clear from the context) if system # can prove that it has a simple type. In this paper we propose new typing rules and algorithms that are able to type recursive definitions that are n ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Let # be a rank2 intersection type system. We say that a term is #simple (or just simple when the system # is clear from the context) if system # can prove that it has a simple type. In this paper we propose new typing rules and algorithms that are able to type recursive definitions that are not simple. At the best of our knowledge, previous algorithms for typing recursive definitions in the presence of rank2 intersection types allow only simple recursive definitions to be typed. The proposed rules are also able to type interesting examples of polymorphic recursion (i.e., recursive definitions rec {x = e} where di#erent occurrences of x in e are used with di#erent types). Moreover, the underlying techniques do not depend on particulars of rank2 intersection, so they can be applied to other type systems.
Principal Typing and Mutual Recursion
, 2001
"... As pointed out by Damas[Dam84], the DamasMilner system (ML) has principal types, but not principal typings. Damas also dened in his thesis a slightly modied version of ML, that we call ML 0 , which, given a typing context and an expression, derives exactly the same types, and provided an algorith ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
As pointed out by Damas[Dam84], the DamasMilner system (ML) has principal types, but not principal typings. Damas also dened in his thesis a slightly modied version of ML, that we call ML 0 , which, given a typing context and an expression, derives exactly the same types, and provided an algorithm (named as T) that infers principal typings for ML 0 . This work extends each of ML 0 and T with a new rule for typing mutually recursive letbindings. The proposed rule can type more expressions than the corresponding rule used in ML, by allowing mutually recursive denitions to be used polymorphically by other denitions. 1