Skip to content
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 leftWiden not available for Nothing error type #3406

Open
Adriani-Furtado opened this issue Apr 26, 2020 · 2 comments
Open

EitherT leftWiden not available for Nothing error type #3406

Adriani-Furtado opened this issue Apr 26, 2020 · 2 comments

Comments

@Adriani-Furtado
Copy link

Adriani-Furtado commented Apr 26, 2020

It seems leftWiden is not available for EitherT with type Nothing as the error.
A proposal was to add leftWiden directly into EitherT instead of having it be implicit

EitherT(cats.effect.IO(Either.right[Nothing, Int](1))).leftWiden[String]

results in the following message:

type arguments [String] do not conform to method leftWiden's type parameter bounds [AA >: A]
val res7 = EitherT(cats.effect.IO(Either.right[Nothing, Int](1))).leftWiden[String]
@Adriani-Furtado Adriani-Furtado changed the title EitherT leftWiden no available for Nothing error type EitherT leftWiden not available for Nothing error type Apr 26, 2020
@kubukoz
Copy link
Member

kubukoz commented May 2, 2020

I'm 👍 for having that in EitherT, but the problem touches all types with polymorphic errors. If I'm not too mistaken, it should be possible to special-case Nothing and add another implicit extension that only works if the error is of type Nothing.

@joroKr21
Copy link
Member

joroKr21 commented May 7, 2020

But that's a very general problem with scalac and implicits not resolving for Nothing.
The question is if Cats should add specialized instances for Nothing.
I couldn't find any precedent for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants