What's the difference between
and
Enter two words to compare and contrast their definitions, origins, and synonyms to better understand how those words are related.

Functor vs Contravariance - What's the difference?

functor | contravariance |

In category theory terms the difference between functor and contravariance

is that functor is a structure-preserving mapping between categories: if F is a functor from category C to category D, then F maps objects of C to objects of D and morphisms of C to morphisms of D such that any morphism f:XY of C is mapped to a morphism F(f): F(X) → F(Y) of D, such that if h = g \circ f then F(h) = F(g) \circ F(f), and such that identity morphisms (and only identity morphisms) are mapped to identity morphisms. Note: the functor just described is covariant while contravariance is a functor which reverses composition.

As nouns the difference between functor and contravariance

is that functor is a function word while contravariance is the reversal of the order of data types acted upon by an operator.

functor

Noun

(en noun)
  • (grammar) a function word
  • (computing) a function object
  • (category theory) a structure-preserving mapping between categories: if F'' is a functor from category ''C'' to category ''D'', then ''F'' maps objects of ''C'' to objects of ''D'' and morphisms of ''C'' to morphisms of ''D'' such that any morphism ''f'':''X''→''Y'' of ''C'' is mapped to a morphism ''F''(''f''): ''F''(''X'') → ''F''(''Y'') of ''D , such that if h = g \circ f then F(h) = F(g) \circ F(f), and such that identity morphisms (and only identity morphisms) are mapped to identity morphisms. Note: the functor just described is covariant.
  • Hyponyms

    * (in category theory) endofunctor

    Derived terms

    * contravariant functor * representable functor ----

    contravariance

    English

    Noun

  • (label) The reversal of the order of data types acted upon by an operator
  • (label) A functor which reverses composition
  • See also

    * covariance