Go backward to Polymorphic Functions
Go up to Top
Go forward to Recursive Definitions
Parametric Types
- Type definitions with similar structure:
- type BoolPair = Bool x Bool
- type IntPair = Int x Int
- Use parametric definition:
- type Pair[T] = T x T
- type PairOfBool = Pair[Bool]
- type PairOfInt = Pair[Int]
- Type operators are not types:
- type A[T] = T T
- type B = forall T. T T
- Different notions!
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: understand.tex,v 1.1 1996/06/12 09:38:21 schreine Exp schreine