The type of the thing to do on an exception is now
IO b
rather than
IO ()
which better matches functions like bracket.
Nothing -> throw e
Just b -> return (Left b)
Nothing -> throw e
Just b -> return (Left b)
-onException :: IO a -> IO () -> IO a
+onException :: IO a -> IO b -> IO a
onException io what = io `catch` \e -> do what
throw (e :: SomeException)
onException io what = io `catch` \e -> do what
throw (e :: SomeException)