Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Monad transformers and MonadPlus (Daniel Fischer)
----------------------------------------------------------------------
Message: 1
Date: Fri, 30 Jul 2010 14:48:17 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Monad transformers and MonadPlus
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On Friday 30 July 2010 13:56:44, Antoine Latter wrote:
> You could always add a MondPlus instance to IO directly (or a newtype
> wrapper).
>
> 'mplus' would set up exception handling and 'mzero' would through an
> exception. You might want to limit it to a subset of exceptions, though.
Once upon a time, there was a MonadPlus instance for IO.
However, one of the laws a MonadPlus instance should satisfy is
m >> mzero === mzero
You can't have that in IO, since there's no unPutStrLn and such.
Therefore, the MonadPlus instance for IO was removed.
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 25, Issue 58
*****************************************