Move MonadIO to base

Antoine Latter aslatter at
Tue Apr 13 00:24:31 EDT 2010

On Mon, Apr 12, 2010 at 8:53 PM, Isaac Dupree
<ml at> wrote:
> On 04/10/10 11:35, Twan van Laarhoven wrote:
>> If MonadIO were in base, then the base library itself could also use it.
>> For example the functions in System.IO could be lifted to work on any
>> MonadIO monad. Whether that is a good idea is completely orthogonal to
>> this discussion, however.
> I think it is relevant to the discussion to consider whether the MonadIO
> class is a good idea in general -- if it's not a broad enough use, then
> maybe we shouldn't implicitly sanction it by putting it in 'base'.  Is it
> mainly to make monad-transformer code more readable* by requiring fewer
> explicit lifts?  Are there other reasons? (Pointing to example code that
> uses MonadIO would be a good answer.)

This is the code which prompted my original thread:

So the answer to your question is 'polymorphism'.

> *i've grown increasingly doubtful of the idea that more classes /
> less-explicit code reliably makes things more readable.

Perhaps true! At the time I wrote the above, I was frustrated with
having to nail myself down to a particular technique of
signaling/expressing errors, so I erred on the side of polymorphism.

> (I see nothing wrong with splitting MonadIO out into a new package (besides
> that proliferation of packages is a bit annoying)...
> )

I would be for any approach which lets me use MonadIO without pulling
in the mtl or transformers.


More information about the Libraries mailing list