-
-
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
Bifoldable #94
Comments
Yep, I would like to see |
It's worth mentioning that |
Those only require that |
Is there consensus here? So far it seems like @ceedubs and @tpolecat would like to see this and @mpilquist is skeptical? |
I personally use Bifoldable from Scalaz on a regular basis and would like to have it. Plus it gives rise to wildly useful things like 👍 |
Re-reading this just now, I'm not skeptical of adding |
Also: - Add MonadCombine separate - Add serializability check for Bifunctor[Xor]
Bifoldable
is a type class (currently not in cats) for a type that has two separateFoldable
s. For example,Or
has aFoldable
instance (via itsTraverse
instance) that folds over theRightOr
case, butOr
could equally fold over theLeftOr
case.One of my favorite methods from scalaz is
MonadPlus.separate
. This can do things like take aList[A Or B]
and turn it into a(List[A], List[B])
. Or similarly, take aList[(A, B)]
and turn it into a(List[A], List[B])
. In Cats, I believe we could implement the same sort of method onMonadFilter
if we were to bring in aBifoldable
type class.What do people think? Is this something that would belong in
core
?The text was updated successfully, but these errors were encountered: