[Haskell-cafe] Current situation regarding global IORefs

Brian Hulley brianh at metamilk.com
Fri Apr 21 17:29:33 EDT 2006

Brian Hulley wrote:
> Robert Dockins wrote:
>> Sometimes I also think it would be nice if all the standard lib
>> functions with IO types would instead take arbitrary MonadIO types,
>> so you could avoid having to write down liftIO all the time....
> Thanks for the suggestion - it is certainly a lot better to write
> liftIO inside my FFI wrappers than each time I use these functions
> elsewhere.
>> One additional (very
>> unfortunate) point is that higher-order IO monad combinators will not
>> work on your monad, eg, the ones in Control.Exception.  I hope H'

I see now what you mean. This really kills any attempt to make my own api 
use MonadIO since things like bracket_ etc are fundamental. Thus the use of 
IO in Control.Exception has a kind of viral property that destroys all hope 
of eradicating liftIO from user code...

Regards, Brian. 

More information about the Haskell-Cafe mailing list