| | Analysis | Requirements & Principles |
architecture: Paradigms |
substance: Abstractions |
structure: Domains | building blocks: Features |
surface: Syntactics | Defining PLs |
Language List | ||
| foundational | safety | flexibilized | |||||||||
| |||||||||||
If you know further references, please don't hesitate to tell me (Ulf Schünemann), likewise if you have any suggestions.
[DTT] Gilles Barthe: Dependent Type Theory; preliminary lecture notes for APPSEM'2000.
[ITBP] Benjamin C Pierce: Intersection Types and Bounded Polymorphism; Math Struct in Comp Sci 11; Cambr Univ Pr 1996.
[HOS] Martin Steffen, Benjamin Pierce: Higher-Order Subtyping; TR ECS-LFCS-94-280; Univ Edinburgh 1994.
[PLCS] Kim Mens: An Introduction to Polymorphic Lambda Calculus with Subtyping; 1994.
[PolyP] PolyP - an extension of Haskell
[TCFD] Mark P Jones: Type Classes with Functional Dependencies; ESOP'2000; LNCS 1782.
[TMTC] Dominic Duggan, John Ophel: Type-checking multi-parameter type classes; 133-158 in JFP 12(2); Cambridge Univ Press, March 2002.
|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| intersection types
t1 & t2 : TYPE [[t1 & t2]] = [[t1]]
|
Write their types as a type scheme all t.T
which represent a family of types generated from it:
(dynamic overloading) The combined type is a type, denoting the intersection of the types of the overloaded function's branches.
How to type parametrically overloaded functions?
| PARAMETRIC POLYMORPHISM How to type generic functions? (cf. type-oriented programming) abstraction [<]: AD-HOC POLY- MORPHISM How to type ad-hoc overloaded functions, (a function f "with several types" t1, t2, etc.)
BASIC TYPE SYSTEM
| each t:TYPE is a subset of VALUE direction of | DEPENDENT TYPES OVERLOADING (syntactic sugar) INCLUSION POLYMORPHISM How to model subclassing (how to type this)?
HIGHER-ORDER TYPES type-classes (single parameter type predicates): each k:TYCL is a subset of TYPE
|
type-constructor-classes
| each kk:TYCCL is a subset of TYCON
type relations ("multi-parameter type-classes")
|
(-) Expresses only arbitrary relationships between the two type parameters. Hence, type inference will accept, if it cannot concretize the type a container, the use of a (monomorphic) container as Collects Bool ce and as Collects Char ce [TCFD]. type/type-constructor relations
| class Collects e c where empty :: c e insert :: e -> c e -> c e (-) Works only with generic collection types [TCFD].
(+) allows to express partial 1:1 mappings between types
(class E a b | a ~> b, b ~> a where ...),
and combined dependencies, eg. to type arithm. ops. mixing int and floats:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The simply typed lambda calculus with its function types (F)
has been extended to support various combinations of
types for polymorphic values (P), higher-order types (H), and dependent types (D).
Barendregt's lambda-cube [DTT] shows these extensions
as 3 dimensions of type system development.
In the Pure Type System framework [DTT],
these type systems are characterized by whether and how they relate
- type expressions (first-class types) like T, and Tx
(where x occurs as free value identifier).
- generic type schemes (second-class types);
let Gt by a type or generic type
where t occurs as free type identifier.
- metatype expressions (aka kinds, type-classes, types of types)
like M, and Mt
(where t occurs as free type identifier).
|   | | impredicative | (polymorphic types) predicative | (type schemes) has as
| type
| type
| type scheme
| metatype
| metatype
| something like
| x:T' => Tx
| t:M' => Tt
| t:M' => Gt
| t:M' => Mt
| x:T' => Mx
|
alternative syntax examples | T' -> T | (not using x) a -> a, or
| template<class a> a& id(a&); Eq
| ?
|
| Eq a => (a, a) -> bool
| ?
|
int[0..x] (in context of some x:nat),
| template<int x> int len(int (&)[x]); for typing, e.g.
| value-parameterized | values, i.e. functions esp. polymoprhic functions type-parameterized types
| value-parameterized types, | esp. arrays of unknown fixed length | ||||||||
|   | types types untyped LC [Church 1930s]
| with term abstraction and application | |
| simply typed LC (function types) [Church 1940] (according to [HOS])
| | |
| Fomega
with higher-order types 'kinds' ('*' for types, 'K -> K' for type operators), and
with types, type constructors, constructors of type constructors and so on as first class citizens (according to [PLCS])
by [Girard's dissertation 1972] (according to [DTT])
| | + |
| with type abstraction and application [Girard's dissertation 1972, Reynolds 1974] universal (impredicative) | |
| in ML [Milner 1978]
| universal (predicative) | |
| intersection types by Coppo & Dezani-Ciancaglini (1978), Sallé [Coppo etal 1979, Sallé 1982], and Pottinger (1980)
(according to [ITBP])
| | finite
|
equivalence between rank 2 fragments of System F and rank 2 intersection system
[Hirofumi Yokouchi: Embedding a Second-Order Type System into an Intersection Type System; 206-220: Information and Computation 117, 1995]
| | +
| subtype bounded (impredicative) | | +
| | type checking undecidable, | but there are decidable variants (cf. below) F-bounded polymorphism
explains compatibility between subclasses and baseclasses,
allows typing self [Canning etal's 1989, Cook etal. 1990]
| F-bounded | |
| Fomega<
- in it objects can be encoded and the interaction between subclassing and object encapsulation can be modeled
| [Cardelli 1990, Mitcehell 1990, Bruce & Mitchell 1992]. Semantic model with PERs [Cardellig & Longo 1991] subtype bounded | + | +
| infinite intersection types Leivant 1990 (according to [ITBP])
| | infinite
| union types (as duals of intersection types) in 1991 by Barbanera & Dezani-Ciancaglini, by Hayashi, by Pierce
(according to [ITBP])
| | +
| F/\ = | [B Pierce: Programming with Intersection Types and Bounded Polymorphism; PhD thesis; 1991] subtype bounded | | + | finite
| Fomega/\
| [Compagnoni & Pierce 1993, Adriana B Compagnoni, Benjamin C Pierce: Higher-Order Intersection Types and Multiple Inheritance; Math Struct in Comp Sci 11; Cambr Univ Pr 1995] subtype bounded | + | + | finite
| Calculus of constructions | (Coquand & Huet) + / - | + | | +
| (Longo & Moggi)
| + / - | | +
| XML (Harper & Mitchell)
| - / + [typo in DTT?] | | + [typo in DTT?]
| Lambda omega [DTT]
| | +
| Lambda P omega [DTT]
| | + | | +
| in Automath, Elf
| | | +
| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Feature | Description | Argument | ||||||||
| Dot-notation vs. open-construct
for using modules with opaque/existential types [ATDN] Luca Cardelli and Xavier Leroy: Abstract Types and the Dot Notation; DEC/SRC Research Report 56, 1990. | Algebra complex implementing the signature of complex numbers (see ADT)
could be used by clients in two ways:
-- open construct
open complex as {C; cmk,cre,cim,cmul};
function csqr(x:C) = cmul(x,x);
return cre(csqr(cmk(2,3)));
|
| | Analysis | Requirements & Principles | Paradigms | Abstractions | Domains | Features | foundational | safety | flexible typing | Syntactics | Defining PLs | Language List |