4 ms·
i think the way you defined it, covariant and contravariant are identical; in your contravariant definition, swap the names of "A" and "B" and you get: if B
by bshanks 10y ago
i think the way you defined it, covariant and contravariant are identical; in your contravariant definition, swap the names of "A" and "B" and you get:
if B >: A, then F[A] <: F[B]
and B >: A means the same as A <: B, so this means:
if A <: B, then F[A] <: F[B]
which is the same as your covariant definition.
Perhaps you meant:
If F[_] is "contravariant", it means that if A <: B, then F[B] <: F[A]
?