-
-
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
XorTInstances + cleanup tests #1106
Conversation
Current coverage is 88.64%
@@ master #1106 diff @@
==========================================
Files 227 227
Lines 2946 2959 +13
Methods 2890 2904 +14
Messages 0 0
Branches 53 52 -1
==========================================
+ Hits 2611 2623 +12
- Misses 335 336 +1
Partials 0 0
|
Looks good to me! Thanks! 👍 |
As @peterneyens pointed out, the EDIT2: Thought about this further and I think that it's not possible to have a If Because of that, I'm going to remove the EDIT: So I played around with this, and interestingly enough:
Going to fix this tomorrow. |
Yes, it's not possible. see scalaz/scalaz#255 |
Added `Eq`, `PartialOrder`, `Order`. Added `SemigroupK`, `MonoidK` Added `Foldable`, `Traverse` Added `MonadError`, `MonadCombine` and `MonadFilter` (the last two instances are dissabled, because they violate the same laws as the equivalent XorT instances). Rewrote the tests to use `ListWrapper`. I used the ListWrapper methods added by @yilinwei in typelevel#1106.
I've removed the I think it may be good to add a helper method onto |
Added `Eq`, `PartialOrder`, `Order`. Added `SemigroupK`, `MonoidK` Added `Foldable`, `Traverse` Added `MonadError`, `MonadCombine` and `MonadFilter` (the last two instances are dissabled, because they violate the same laws as the equivalent XorT instances). Rewrote the tests to use `ListWrapper`. I used the ListWrapper methods added by @yilinwei in typelevel#1106.
|
||
def ap[AA >: A, BB >: B, C](that: AA Xor (BB => C)): AA Xor C = that.flatMap( | ||
f => this.map(a => f(a)) | ||
) |
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: I think this could simply be that.flatMap(this.map)
👍 thanks! @non does this still look good to you? |
LGTM 👍 |
Add
Semigroup
andMonoid
forXorT
.Also, cleanup the tests so the implicit resolution is clear.