Scala’s type system allows us to annotate type parameters with their variance: covariant, contravariant, invariant. Variance allows us to define the subtyping relationships between type constructors – that is, under which conditions F[A] is a subtype of F[B]. Similarly in functional programming, there are covariant functors, contravariant functors, and invariant functors. The similarity in names is not coincidental. Covariance The common example is List[+A] which is covariant in its type ...