... | ... | @@ -72,6 +72,14 @@ instanceAlternativeFoowhere(<|>)= mplus |
|
|
empty = mzero
|
|
|
```
|
|
|
|
|
|
|
|
|
If pre-AMP compatibility is not a requirement, it's better to define `MonadPlus` in terms of `Alternative` as this corresponds to the superclass relationship and allows to omit the method definitions in `MonadPlus`, i.e.
|
|
|
|
|
|
```
|
|
|
instanceAlternativeFoowhere
|
|
|
empty ={- move definition of `mzero` here -}(<|>)={- move definition of `mplus` here -}instanceMonadPlusFoo-- NB: starting with `base-4.8`: no need to override methods here!
|
|
|
```
|
|
|
|
|
|
#### GHC says `No instance for (Foldable ...) arising from the use of...`
|
|
|
|
|
|
|
... | ... | |