Remove MonadFilter, and fix MonadCombineLaws#1342
Remove MonadFilter, and fix MonadCombineLaws#1342eed3si9n wants to merge 1 commit intotypelevel:masterfrom
Conversation
Fixes typelevel#1336 The `MonadCombine` typeclass unifies `Monad`, `FunctorFilter`, and `MonoidK`, bringing three of the lineages together. This uses the emptiness notion introduced in `MonoidK` and `flatMap` to implement `mapFilter`, along with `unite`. Given that `MonadCombine` exists, which is Cats equivalent of `MonadPlus` there's no need for `MonadFilter` to exist. The laws are migrated over from `MonadFilter` to `MonadCombine`, except these laws would now check identity laws and the consistencies against the correct `F.empty` from `MonoidK`.
Can you expand on this? Doesn't this mean we can't define |
Current coverage is 91.54% (diff: 88.88%)@@ master #1342 diff @@
==========================================
Files 237 233 -4
Lines 3567 3550 -17
Methods 3502 3487 -15
Messages 0 0
Branches 64 62 -2
==========================================
- Hits 3260 3250 -10
+ Misses 307 300 -7
Partials 0 0
|
Yes. If I want to define |
|
|
Fixes #1336
The
MonadCombinetypeclass unifiesMonad,FunctorFilter, andMonoidK, bringing three of the lineages together. This uses theemptiness notion introduced in
MonoidKandflatMapto implementmapFilter, along withunite.Given that
MonadCombineexists (our equivalent ofMonadPlus) there's no need forMonadFilterto exist.The laws are migrated over from
MonadFiltertoMonadCombine, except these laws would now check identity laws and the consistencies against the correctF.emptyfromMonoidK.