[Haskell] Re: generic catch in a MonadIO

Taral taralx at gmail.com
Wed Feb 8 14:34:25 EST 2006


On 2/8/06, Ashley Yakeley <ashley at semantic.org> wrote:
> IIRC, that subset is types that can implement this:
>
>    class (MonadIO m) => StrictMonadIO m where
>        getUnliftIO :: m (m a -> IO a)

You probably mean "m (forall a. m a -> IO a)" and that is not allowed.
You have to CPS it:

withUnliftIO :: ((forall a. m a -> IO a) -> m a) -> m a

--
Taral <taralx at gmail.com>
"Computer science is no more about computers than astronomy is about
telescopes."
    -- Edsger Dijkstra


More information about the Haskell mailing list