[Haskell-cafe] IO vs MonadIO

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Wed Sep 12 11:55:50 CEST 2012


On 12 September 2012 18:24, Sergey Mironov <ierton at gmail.com> wrote:
> Hi. Just a brief question. System.IO functions are defined in IO monad
> and have signatures like Foo -> IO Bar.
> Would it be better to have all of them defined as (MonadIO m) => Foo
> -> m Bar? What are the problems that would arise?

That would require MonadIO being defined in base, and might make some
existing code fail due to lack of type signatures (though I suppose
you could specify a default).

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list