Principal type-schemes for functional programs
read more
Citations
Types and Programming Languages
The Definition of Standard ML
On understanding types, data abstraction, and polymorphism
Haskell 98 language and libraries : the revised report
Lazy abstraction
References
A Machine-Oriented Logic Based on the Resolution Principle
A theory of type polymorphism in programming
The Principal Type-Scheme of an Object in Combinatory Logic
An Extended Polymorphic Type System for Applicative Languages
Related Papers (5)
Frequently Asked Questions (10)
Q2. What is the semantic domain for Exp?
The semantic domain V for Exp is a complete partial order satisfying the following equations up to isomorphism, where Bi is a cpo corresponding to primitive type ιi :V = B0+B1+ · · ·+ F +W (disjoint sum) F =V →V (function space)W = {·} (error element)To each monotype µ corresponds a subset V , as detailed in [5]; if v ∈ V is in the subset forµwe write v :µ.
Q3. What is the simplest way to define a type-scheme?
There is an algorithm U which, given a pair of types, either returns a substitution V or fails; further(i) If U (τ,τ′) returns V , then V unifies τ and τ′, i.e. V τ = τ′.(ii)
Q4. What is the syntax of type variables?
Assuming a set of type variables α and of primitive types ι, the syntax of types τ and of type-schemes σ is given byτ ::= α | ι | τ→ τ σ ::= τ | ∀ασA type-scheme ∀α1 . . .∀αnτ (which the authors may write ∀α1 . . .αnτ) has generic type variables α1 . . .αn .
Q5. What is the type of the closure of a type?
The authors also need to define the closure of a type τ with respect to assumptions A;A(τ) = ∀α1, . . . ,αnτwhere α1, . . . ,αn are the type variables occurring free in τ but not in A.
Q6. what is the simplest way to prove that e is a type-scheme?
If e is e1 e2 then let W (A, e2) = (S1,τ2) and W (S1A, e2) = (S2,τ2) and U (S2τ1,τ2→ β) =V where β is new; then S =V S2S1 and τ =Vβ.(iii)
Q7. What is the author's support for the polymorphic type discipline of ML?
†The work of this author is supported by the Portuguese Instituto Nacional de Investigacao Cientificaletrec map f s = if null s then nilelse cons(f(hd s)) (map f (tl s))
Q8. what is the simplest way to deduce a type-scheme?
Moreover if there is a derivation of A` e :σ of height n then there is also a derivation of SA` e : Sσ of height less [than] or equal to n.
Q9. What is the semantic function " : Exp?
Using it, the authors wish to attach meaning to assertions of the formA |= e :σwhere e ∈ Exp and A is a set of assumptions of the form x :σ , x ∈ Id.
Q10. what is the main result of this paper?
the main result of this paper is that the type-scheme deduced for such a declaration (and more generally, for any ML expression) is a principal type-scheme, i.e. that any other type-scheme for the declaration is a generic instance of it.