From f3b6c6b77f1667164913725dcfe12f64b9e99f74 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 3 Aug 2008 00:30:01 +0000 Subject: [PATCH] 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. --- Control/Exception.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 1.7.10.4