Type constructors in programming languages which preserve subtype relations
This tag regards a feature of type-constructors in programming languages: syntactic constructs which are applied to types to produce other types. Example of type constructors: An array of elements of the original type, a pointer to the original type etc.
A unary type constructor tc
is covariant if applying tc
preserves the subtype relationship of types. That is, if B
is a subtype of A
, then tc
applied to B
is a subtype of tc
applied to A
.
If the subtype relationship is inverted rather than preserved, the type constructor is contravariant.
Further reading (Wikipedia).