Add contravariant instances for Const and Kleisli#626
Conversation
|
Ah thanks, I was running into diverging implicits with |
There was a problem hiding this comment.
Am I correct to guess that you were forced into doing this because the implicit instances wasn't inferred?
There was a problem hiding this comment.
No, I've just checked and it works fine without. I was just blindly following the pattern in the rest of the test suite. Happy to push up without if that's preferred.
There was a problem hiding this comment.
I think if it can be inferred then we should probably let it be inferred in the tests. If nothing else, it provides an extra test that we don't break implicit resolution for this instance without realizing it :)
There was a problem hiding this comment.
I've gone through and changed KleisliTests to not explicitly specify the implicits.
Current coverage is
|
|
@philwills Sorry for the hassle, but I think that while it was fine to not be explicit about the If you just type In some places we are using a In the case of the |
|
The issues with the tests are subtle, and hopefully at some point we form a good convention for this sort of thing. But other than that, the actual implementation looks correct and clean to me. Thanks for this, @philwills! |
ac58e2f to
697c4ad
Compare
|
OK, I've reverted the change to all but the new test. Thanks for being so clear with your explanation. |
|
Looks great! 👍 |
|
Looks good to me. Thanks @philwills ! 👍 |
Add contravariant instances for Const and Kleisli
I realise that this is very similar to @vikraman's work in #590, but I think this addresses the issues raised by @ceedubs and it was much easier to get this working against master than raising a PR onto that branch, thanks to the removal of
ArbitraryK.