Summary: An Introduction to Dependent Types and
3 July 2009
Types in programming languages serve several purposes:
1. Find runtime-errors at compile-time.
2. Enable compiler optimizations.
3. Allow the programmer to express some of his intention about the code.
4. Provide a machine-checked documenation.
Strongly typed languages include JAVA and Haskell. Dependent types allow the program-
mer to add even more redundant information about his code which leads to detection
logical errors or full program verication.
1.1 What is a dependent type?
Dependent types mean that types can refer to values, not just to other types. From the
mathematics, uses of dependent types are familiar. For instance, in linear algebra we
dene the type of vectors Rn of length n by
Rn = R ◊ ∑ ∑ ∑ ◊ R
and the inner product of two vectors of length n receives type Rn ◊ Rn R. This type