Fixing MonadIO

Simon Marlow simonmarhaskell at gmail.com
Mon Feb 4 11:25:18 EST 2008


Yitzchak Gale wrote:
> Simon Marlow wrote:
>>  Avoiding
>> exceptions because MonadIO has trouble with them is not a good enough
>> reason, IMO.  We should fix MonadIO instead.
> 
> I'm all for it!
> 
> Below is a summary of the three approaches
> that have been proposed, as far as I can remember:
> 
> 1. Make the functions in Control.Exception more polymorphic.
>    This is part of the more general program of providing polymorphic
>    IO described in Haskell' ticket 110. Brian Hulley attached to that
>    ticket a version of Control.Exception that does this by introducing
>    the MonadException subclass of MonadIO.
> 
>    http://hackage.haskell.org/trac/haskell-prime/attachment/ticket/110/Exception.txt

Correct me if I'm wrong, but it doesn't seem to be necessary to modify 
Control.Exception directly in order to adopt this proposal.  The new module 
could be provided as Control.Monad.IO.Exception (for example) in the mtl 
package.  No changes to the base package are required to make this 
functionality available to everyone.  Right?

If so, this seems like the smoothest way to address the problem.

Cheers,
	Simon


More information about the Libraries mailing list