
On Friday 05 September 2003 1:02 pm, Keith Wansbrough wrote:
-- ** The @handle@ functions - handle, -- :: (Exception -> IO a) -> IO a -> IO a - handleJust,-- :: (Exception -> Maybe b) -> (b -> IO a) -> IO a -> IO a + handle, -- :: MonadIO m => (Exception -> m a) -> m a -> m a + handleJust,-- :: (Exception -> Maybe b) -> (b -> m a) -> m a -> m a
Is the MonadIO constraint on m intentionally missing from handleJust?
No, it's an unfortunate omission. Thanks for pointing that out! Corrected patch attached.
This patch is still too deeply wired-in for my liking. It generalises the types of all the IO-related functions in Control.Exception. We don't intend to generalise *every* IO function over MonadIO, that's what liftIO is for. And hence, we shouldn't also generalise functions that take IO-typed arguments, since that is what liftIO' is for, and so on. By all means provide the generalised versions for convenience, but I don't believe we should generalise the originals. Cheers, Simon
participants (1)
-
Simon Marlow