[Haskell] Re: generic catch in a MonadIO

Ashley Yakeley ashley at semantic.org
Wed Feb 8 14:17:22 EST 2006

oleg at pobox.com wrote:
> The ability to use functions 'catch', 'bracket', 'catchDyn', etc. in
> MonadIO other than IO itself has been a fairly frequently requested
> feature:
> The reason it is not implemented is because these functions cannot be
> defined for a general MonadIO. However, these functions can be easily
> defined for a large and interesting subset of MonadIO. 

IIRC, that subset is types that can implement this:

   class (MonadIO m) => StrictMonadIO m where
       getUnliftIO :: m (m a -> IO a)

More information about the Haskell mailing list