Types and Programming Languages | Existential Types
Existential quantifiers offering an elegant foundation for data abstraction and information hiding.
- An element of is a value of type for some type .
- An element of is a pair, written of type and a term t of type
An existentially typed value is introduced by pairing a type with a term, written . (Another common notation is )
The type is often called the hidden representation type, or sometimes the witness type of the package.
A useful concrete intuition is to think of a value of type as a simple form of package or module with one (hidden) type component and one term component.
For example, the package Nat. has the existential type (can also has type
The ambiguity shows that , the typechecker cannot make an automatic decision about which existential type a given package belongs to: the programmer must specify which one is intended.