Contravariance
noun
noun ·Rare ·Advanced level
Definitions
Noun
- 1 The reversal of the order of data types acted upon by an operator. countable, uncountable
"I get why with covariance I can return a Dog (a Dog is a Mammal), but why does contravariance work the other way? Shouldn't it accept a derived type when it expects a base type? Contravariance is consistent with Postel's Law: […]"
- 2 A functor which reverses composition. countable, uncountable
- 3 Of vectors, the property of scaling inversely with a change of basis, as opposed to covariance. countable, uncountable
Synonyms
All synonymsExample
More examples"I get why with covariance I can return a Dog (a Dog is a Mammal), but why does contravariance work the other way? Shouldn't it accept a derived type when it expects a base type? Contravariance is consistent with Postel's Law: […]"
Etymology
From contra- + variance.
More for "contravariance"
Data sourced from Wiktionary, WordNet, CMU, and other open linguistic databases. Updated March 2026.