This code is not compiling in scala 2.13.16:
import izumi.reflect.{TagK, TagKK, HKTag}
type Mono[F[_], x, y] = F[Either[x, y]]
def foo[F[_]: TagK]: TagKK[Mono[F, *, *]]] =
implicitly // compiler error: could not find implicit value for parameter e: izumi.reflect.TagKK[[β$0$, γ$1$]F[scala.util.Either[β$0$,γ$1$]]]
The same code is compiling in scala 3 without compiler errors:
//> using scala 3.6.2
//> using dep "dev.zio::izumi-reflect:3.0.0"
import izumi.reflect.{TagK, TagKK, HKTag}
type Mono[F[_], x, y] = F[Either[x, y]]
def foo[F[_]: TagK]: TagKK[[x, y] =>> Mono[F, x, y]] =
implicitly // ok
As a workaround type Mono[F[_], x, y] >: F[Either[x, y]] <: F[Either[x, y]] works.
Scastie: https://scastie.scala-lang.org/road21/j3t7ODHHQzqjYW0hPysctg/30
This code is not compiling in scala 2.13.16:
The same code is compiling in scala 3 without compiler errors:
As a workaround
type Mono[F[_], x, y] >: F[Either[x, y]] <: F[Either[x, y]]works.Scastie: https://scastie.scala-lang.org/road21/j3t7ODHHQzqjYW0hPysctg/30