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

Ambiguous implicit values for Functor[Kleisli[F, A, ?]] #2608

Closed
mielientiev opened this issue Nov 13, 2018 · 2 comments · Fixed by #2618
Closed

Ambiguous implicit values for Functor[Kleisli[F, A, ?]] #2608

mielientiev opened this issue Nov 13, 2018 · 2 comments · Fixed by #2618

Comments

@mielientiev
Copy link

mielientiev commented Nov 13, 2018

I see the next error in 1.4.0 and 1.5.0-RC0 cats:

 ambiguous implicit values:  both method catsDataApplicativeErrorForKleisli in class KleisliInstances4 of type [F[_], E, A](implicit F0: cats.ApplicativeError[F,E])cats.ApplicativeError[[γ$58$]cats.data.Kleisli[F,A,γ$58$],E]
[error]  and method catsDataFlatMapForKleisli in class KleisliInstances4 of type [F[_], A](implicit FM: cats.FlatMap[F])cats.FlatMap[[γ$59$]cats.data.Kleisli[F,A,γ$59$]]
[error]  match expected type cats.Functor[Kleisli[Result, NodeSeq, A]]
@kailuowang kailuowang added the bug label Nov 16, 2018
@kailuowang kailuowang added this to the 1.5.0-RC1 milestone Nov 16, 2018
@kailuowang
Copy link
Contributor

kailuowang commented Nov 16, 2018

This a bug caused by the two methods at the same trait and thus priority. https:/typelevel/cats/blob/master/core/src/main/scala/cats/data/Kleisli.scala#L294-L299

Looks like we can move either up or down. So we will have to insert a new trait into the chain
to reduce BC change maybe name it KleisliInstances4a?
We can place this new trait in between KleisliInstances4 and KleisliInstances5 and move one of the instances, say catsDataApplicativeErrorForKleisli to it, and to avoid a mima exception we can leave the original one but make it non-implicit.

@barambani
Copy link
Contributor

On it 👍

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

Successfully merging a pull request may close this issue.

3 participants