Make.Equality_witness
This module provides support for type equalities and runtime type identifiers.
For two types a
and b
, (a, b) eq
is a witness that a = b
. This is a standard generalized algebraic datatype on top of which type-level programming techniques can be implemented.
Given a type a
, an inhabitant of a t
is a dynamic identifier for a
. Identifiers can be compared for equality. They are also equipped with a hash function.
WARNING: the hash function changes at every run. Therefore, the result of the hash function should never be stored.
Notice that dynamic identifiers are not unique: two identifiers for a
can have distinct hash and can be physically distinct. Hence, only eq
can decide if two type identifiers correspond to the same type.