Skip to content

EitherT[Option, ?, ?]] can't be used as a bifunctor #4569

@strokyl

Description

@strokyl

With scala 2.13.12
and cats-core 2.10.0

  type MyBifunctor[A, B] = EitherT[Option, A, B]
  val myByFunctor = implicitly[Bifunctor[MyBifunctor]]

Does not compile :

ambiguous implicit values:
 both method catsDataBitraverseForEitherT in class EitherTInstances1 of type [F[_]](implicit F: cats.Traverse[F]): cats.Bitraverse[[β$69$, γ$70$]cats.data.EitherT[F,β$69$,γ$70$]]
 and method catsDataBifunctorForEitherT in class EitherTInstances of type [F[_]](implicit F: cats.Functor[F]): cats.Bifunctor[[β$15$, γ$16$]cats.data.EitherT[F,β$15$,γ$16$]]
 match expected type cats.Bifunctor[A.MyBifunctor] [25:21]

And unfortunately both:

  • catsDataBifunctorForEitherT
  • catsDataBitraverseForEitherT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions