An endofunctor maps every object in a category to another object in that same category while preserving morphisms. In the category of types, assignment compatibility supplies the morphisms. section 7.1 section 7.4
For a covariant generic interface such as IE<T>, the mapping sends each type T to IE<T>. If Giraffe is assignment-compatible with Animal, IE<Giraffe> must likewise be assignment-compatible with IE<Animal>. Covering every type requires allowing arbitrarily nested constructions such as IE<IE<Giraffe>>. section 7.2
Covariant generic interface
interface IE<out T> { T Current { get; } bool MoveNext(); } IE<Animal> values = giraffes; The out modifier makes the output-only type parameter covariant, permitting an IE<Giraffe> value to be assigned to IE<Animal>. The resulting type mapping mirrors the original assignment-compatibility arrows. section 7.2
interface IE<out T>
{
T Current { get; }
bool MoveNext();
}
Inspect the covariant interface declaration that makes the endofunctor analogy visible in C#. section 7.2
