-
-
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
Adds Semigroup for Xor #717
Conversation
As per typelevel#716, adding a Semigroup for the Xor data type which currently has a Monoid instance but no Semigroup instance.
@@ -12,7 +12,8 @@ import org.scalacheck.Arbitrary._ | |||
import scala.util.Try | |||
|
|||
class XorTests extends CatsSuite { | |||
checkAll("Xor[String, Int]", GroupLaws[Xor[String, Int]].monoid) | |||
checkAll("Monoid[Xor[String, Int]]", GroupLaws[Xor[String, Int]].monoid) | |||
checkAll("Semigroup[Xor[String, NonEmptyList[Int]]]", GroupLaws[Xor[String, NonEmptyList[Int]]].semigroup) |
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.
Minor: monoid
/semigroup
are already included in the test names, so I think the convention has been to not include Monoid
/Semigroup
in the string argument.
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.
I see - I can certainly change this. For some reason I'd thought I'd seen a mix of these versions, but I see now it was likely my eyes deceiving me. :-)
👍 if/when the build passes. @mikejcurry you are on a roll again! :) |
Current coverage is
|
Pushed a change to keep things in line with naming conventions for tests. Maybe I should add this convention to the contributors guide? |
@mikejcurry that would be great! Thank you. I think the sole exception is the Cats serializability test, since the same one is used for all types. Actually, if you are already going to make a change, could you add that all type class instances should also be checked with the serializability tests unless they are being checked by Algebra's laws ( |
Sure, have to head away for a while now, so it may not be today, but I'll get to it some time soon. |
👍 |
As per #716, adding a
Semigroup
for theXor
data type which currentlyhas a
Monoid
instance but noSemigroup
instance.