[Haskell] New monadic implementation of Control.Exception

Brian Hulley brianh at metamilk.com
Mon Apr 24 22:28:42 EDT 2006

Hi -
Following indications in 
http://www.haskell.org/pipermail/haskell/2006-February/017547.html I've 
wrapped all the functions in Control.Exception so that they can be used with 
any monad constructed using the common state transformers and based 
(ultimately) on IO.

I'd suggest something like this could be incorporated into Haskell' perhaps 
as a replacement for Control.Exception.

This also relates to 
http://hackage.haskell.org/trac/haskell-prime/ticket/110 but I don't know 
how to attach a file to a ticket therefore I've just enclosed it with this 

(In the discussion following Oleg's original post my experience implementing 
the generalised exception functions showed that getUnliftIO :: m(m a -> IO 
a) mentioned in a later post proved to be a red herring since StateT can't 
support this operation yet it *can* support all the exception ops in a 
sensible way.)

So far, I've only tested catch, catchJust, throwM using a (StateT s IO) 
monad, so I can't be absolutely sure that I've got the semantics for the 
other monads correct, but at least they all compile.... :-)

Regards, Brian. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Exception.hs
Type: application/octet-stream
Size: 9977 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell/attachments/20060425/efd662b0/Exception.obj

More information about the Haskell mailing list