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

SetPartialOrder[A] uses the universal == instead of Eq #1710

Closed
ctongfei opened this issue May 29, 2017 · 4 comments
Closed

SetPartialOrder[A] uses the universal == instead of Eq #1710

ctongfei opened this issue May 29, 2017 · 4 comments

Comments

@ctongfei
Copy link
Contributor

https://github.com/typelevel/cats/blob/master/kernel/src/main/scala/cats/kernel/instances/set.scala#L22

This instance should require an implicit Eq[A] and use this instance for containment partial order / set equivalence.

@kailuowang
Copy link
Contributor

Would it have surprising effects when Set itself doesn't use Eq[A]?

@ctongfei
Copy link
Contributor Author

ctongfei commented May 30, 2017

@kailuowang OK I get it. For the instances for scala.collection.{Set/Map}, use the standard universal equals on keys. Thanks!

@johnynek
Copy link
Contributor

yeah, I think if you use Set and Map they have to use universal equality (on keys for map at least), so doing this differently would really be a bug.

@ctongfei
Copy link
Contributor Author

@johnynek You are right. The equality on them must be the universal one. Thanks!

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