finitetype
Finite type, often written finitetype, is a type that has a finite number of distinct values. If a type A has exactly n elements, we say it has cardinality n. In many type-theoretic and programming contexts, there is a canonical finite type Fin n consisting of the numbers 0 through n−1; a type A is finite if there exists a bijection between A and Fin n for some n.
Finite types are closed under finite products and sums: the product A × B has cardinality |A|·|B|
Examples include the unit type with a single element, the boolean type with two elements, or an
In practice, finite types support exhaustive pattern matching, total functions, and decidable equality. They are central
Limitations: not every data structure is finite; many programs rely on infinite or unbounded types such as