suggestion: use lazy pattern matching for Monoid instances of tuples

Herbert Valerio Riedel hvr at
Sun Aug 18 22:15:57 CEST 2013

On 2013-08-18 at 20:26:23 +0200, Petr Pudlák wrote:


> I'd say that with `undefined` we can fail other equality laws. For
> example: For `MonadPlus` we have `m >>= (\x -> mzero) == mzero`. But
> it clearly fails in
> ```haskell
> undefined >>= (\x -> mzero) :: Maybe Int
> ```
> The result is `undefined` instead of `mzero`. (Or does it mean that
> Maybe is broken?)

Btw/fyi, there was a thread "Monad laws in presence of bottoms" some
time ago on haskell-cafe that seems related:


More information about the Libraries mailing list