Skip to content

Types have a cardinality

In type theory a type has a cardinality. The cardinality for a given type is the number of possible values. A cardinality can be finite or infinite. A pair of types with the same cardinality will always be isomorphic.

Cardinality for a type T is expressed |T|. For example for the type

data Boolean = True | False

Then |Boolean| = 2 should be read as the cardinality of Boolean is equal to 2

References