Contravariants

This just says that if you know how to convert an a into a b, then you can also convert a functor of a into a functor of b. For example, String.length is a String -> Int function, so it can be used to convert a list of strings into a list of integers: [String] -> [Int]. This sort of garden-variety functor is called "covariant".

Contravariant functors look similar, but are used to preprocess input before it reaches a function:

-- like a normal functor, but "f b" and "f a" are reversedclassContravariantfwherecontramap::(a->b)->fb->fa

f b and f a are contravariants, but you can think of them as functions that take a b and an a as input, respectively: