Skip to main content
Version: 1.3.0

Parameteric types

When values are parameterised by values, we obtain functions. Similarly, when a type is parameterised by a type, we obtain parametric types.

For example, we might want to define a type for a pair made of a string and an open type parameter, which be call a binding of a key and a value:

type key = string;
type binding<value> = [key, value];
const int_binding : binding<int> = ["Alice", 4];
const string_binding : binding<string> = ["Bob", "cat"];