Definition
Type Constructor
Variance
Covariant
Definition
Link to originalCovariant Type Constructor
Let and be type. A type constructor is called covariant if it preserves the subtype relation of the types:
where denotes the subtype relation.
Contravariant
Definition
Link to originalContravariant Type Constructor
Let and be type. A type constructor is called contravariant if it reverses the subtype relation of the types:
where denotes the subtype relation.
Invariant
Definition
Link to originalInvariant Type Constructor
Let and be type. A type constructor is called invariant if it is neither covariant nor contravariant:
where denotes the subtype relation.