-
-
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
Fix alleycats Set Functor ambiguous implicits #4678
base: main
Are you sure you want to change the base?
Fix alleycats Set Functor ambiguous implicits #4678
Conversation
@LaurenceWarne , thank you for your help! Regarding the original issue:
In theory, all these instances (i.e., cats/core/src/main/scala/cats/instances/list.scala Lines 36 to 38 in 1cc04ec
I'm not sure why in alleycats these instances were separated in the first place. Perhaps, it was just an oversight. I seems that if we merged them in just one implementor, then it would solve the issue. Perhaps, there were a reason to keep them separated, but I feel it may make sense to give it a shot and merge them. And if the effort fails for some reason, it would be nice to leave a comment about it in the sources, because for now it is not obvious at all. Regarding the binary compatibility issue: |
Makes sense, and FWIW moving all to one implementor doesn't appear to cause any test failures.
I may have misunderstood 😅 , but after moving to a common implementer and changing the old implicits: trait SetInstances {
private[std] val alleyCatsSetTraverse: Traverse[Set] = alleycatsStdInstancesForSet
private[std] val alleyCatsStdSetMonad: Monad[Set] with Alternative[Set] = alleycatsStdInstancesForSet
private[std] val alleyCatsSetTraverseFilter: TraverseFilter[Set] = alleycatsStdInstancesForSet
implicit val alleycatsStdInstancesForSet
: Monad[Set] with Alternative[Set] with Traverse[Set] with TraverseFilter[Set] = ... I run into a few different mima issues:
|
Ah, that's right – Mima gets triggered if you change visibility from public to package-private. I misguided you, sorry. Now I'm recalling that in cases like this one the approach is usually not to change the visibility but rather mark it
Here, |
Note, that it is not necessary to merge the |
Nice, thanks that looks to have worked! Another thing was that I had to use Also, I wasn't sure what best to put in for |
Hmm.. Even without Mima the statement like
where On the other hand, using Would you give it a shot and make |
Hi, on
2.12.0
I find that I get the error:With for example the setup:
To try and fix I've used the approach here: https://typelevel.org/cats/guidelines.html#implicit-instance-priority, which fixes the original problem though introduces binary compatibility issues which I don't know how to fix!:
Suggestions very welcome! Thanks