kittens icon indicating copy to clipboard operation
kittens copied to clipboard

[Scala 3] Extra instances for `Covariant`, `Invariant`

Open TimWSpence opened this issue 3 years ago • 1 comments

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]]]

TimWSpence avatar May 26 '22 09:05 TimWSpence

But both Functor and Contravariant are Invariant which composes. Why do we need special instances for them?

joroKr21 avatar May 27 '22 06:05 joroKr21