kittens
kittens copied to clipboard
[Scala 3] Extra instances for `Covariant`, `Invariant`
For scala 3, we should hopefully be able to support additional derived instances of Invariant and Covariant for nested type constructors. Specifically:
(Invariant[F], Functor[G]) => Invariant[[x] =>> F[G[x]]]
(Invariant[F], Contravariant[G]) => Invariant[[x] =>> F[G[x]]]
(Contravariant[F], Functor[G])=> Contravariant[[x] =>> F[G[x]]]
But both Functor and Contravariant are Invariant which composes.
Why do we need special instances for them?