From: Ian Lynagh Date: Sun, 3 Aug 2008 00:30:01 +0000 (+0000) Subject: Generalise the type of onException X-Git-Tag: 6_10_branch_has_been_forked~100 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f3b6c6b77f1667164913725dcfe12f64b9e99f74;p=ghc-base.git Generalise the type of onException The type of the thing to do on an exception is now IO b rather than IO () which better matches functions like bracket. --- diff --git a/Control/Exception.hs b/Control/Exception.hs index e8032b7..c1dd408 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -337,7 +337,7 @@ tryJust p a = do 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)