Add Bifoldable, fixes #94#864
Conversation
Also: - Add MonadCombine separate - Add serializability check for Bifunctor[Xor]
|
Hmm Travis isn't running - closing and re-opening to see what happens. |
Current coverage is
|
|
There we go |
|
|
||
| implicit def xorBifunctor: Bifunctor[Xor] = | ||
| new Bifunctor[Xor] { | ||
| implicit def xorBifunctor: Bifunctor[Xor] with Bifoldable[Xor] = |
There was a problem hiding this comment.
It looks like we are combining the Bifunctor and Bifoldable instances in some places but not others. I guess if we are going to go forward with #800 then they will eventually be combined anyway. Was there any particular reason behind when they've been combined and when they haven't?
There was a problem hiding this comment.
|
As a note there can also be |
|
👍 |
|
Thanks, @adelbertc! |
|
👍 @stew ? :D |
| /** | ||
| * A type class abstracting over types that give rise to two independent [[cats.Foldable]]s. | ||
| */ | ||
| trait Bifoldable[F[_, _]] extends Serializable { self => |
There was a problem hiding this comment.
extends Any with Serializable ?
There was a problem hiding this comment.
Hmm I see why we would want to do that, but it doesn't seem like we do it in other type classes.. do we?
There was a problem hiding this comment.
Simulacrum does it automatically. We probably aren't consistent with the F[_,_] type classes though.
There was a problem hiding this comment.
Alright I added it for Bifoldable, I've added an issue to do it for the others and I'll probably end up doing it in a future PR unless someone beats me to it
|
👍 I didn't see syntax for |
4a18cce to
a394388
Compare
|
Added some more stuff per @mpilquist 's comments - @ceedubs re-review? :D |
|
👍 Out of curiosity, is the reason we want to extend I could potentially see some value in providing methods to extract a |
|
I'll give @mpilquist another chance to review since there were some changes since his last 👍 |
|
👍 |
I based myself on the structure in syntax.bitraverse for the two implicit conversions (the existing for unite and the new for separate). MonadCombine separate was added in typelevel#864 by @adelbertc.
Also: