-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EitherT[Option, ?, ?]] can't be used as a bifunctor #4569
Comments
Actually they are both public. Implicits have to be public to work at all. How did you try using them, what is the compiler error? |
See also a discussion here about why you should not use |
Yes, there is a conflict indeed among implicits. The problem is that there are both implicit def catsDataBifunctorForEitherT[F[_]](implicit F: Functor[F]): Bifunctor[EitherT[F, *, *]]
implicit def catsDataBitraverseForEitherT[F[_]](implicit F: Traverse[F]): Bitraverse[EitherT[F, *, *]] Consequently, the first one requires // Invariant.scala
implicit def catsInstancesForOption: MonadError[Option, Unit] with Alternative[Option] with CoflatMap[Option] with CommutativeMonad[Option]
// UnorderedFoldable.scala
implicit def catsTraverseForOption: Traverse[Option] Therefore, Scala cannot choose which one to pick up. And it is not just for
☝️ This is for Scala 2.13.13. |
The issue is that the priorities are swapped. |
Sorry you right I was tricked because there were defined in a abstract package private class that is later extended by EitherT.
|
With scala 2.13.12
and cats-core 2.10.0
Does not compile :
And unfortunately both:
are private so I can't provide one explicitly.
I found that issue trying to understand why I could do a leftWiden on :
EitherT[IO, ?, ?] and not on EitherT[Option, ?, ?]
The text was updated successfully, but these errors were encountered: