-
-
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
Move contain_ to UnorderedFoldable #4183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will be source-breaking for anyone relying on something like import cats.syntax.foldable._
instead of a catch-all. I think this is probably ok?
b292d90
to
ef1ee5b
Compare
I'd suppose, it might be reasonable to add |
Good point, that may very well be the case when #4147 materializes :) |
ef1ee5b
to
5aff980
Compare
@satorg @armanbilge I move it to I assume I should test it, but not sure what would be a good test? |
I'd suggest two ways to test it: as you said, consistency with |
5aff980
to
903375d
Compare
@satorg I just pushed the tests, let me know what you think. |
903375d
to
a37b63c
Compare
Well, seems that trait FoldableSyntax extends Foldable.ToFoldableOps with UnorderedFoldable.ToUnorderedFoldableOps {
???
} So we should be safe there (not sure if it makes sense to write a test for that though)... |
f677361
to
c057686
Compare
You may need to add the new laws created to the |
c057686
to
5f6c289
Compare
Oh, right, that explains why the original buggy law did not fail the tests. But I just pushed that change plus the two extra laws you proposed! |
99c2f1f
to
fa6d79e
Compare
tests/shared/src/test/scala/cats/tests/UnorderedFoldableSuite.scala
Outdated
Show resolved
Hide resolved
fa6d79e
to
107eb23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Just some tiny nits :)
laws/src/main/scala/cats/laws/discipline/UnorderedFoldableTests.scala
Outdated
Show resolved
Hide resolved
107eb23
to
32ec37c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
No description provided.