Generalise the type of onException
authorIan Lynagh <igloo@earth.li>
Sun, 3 Aug 2008 00:30:01 +0000 (00:30 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 3 Aug 2008 00:30:01 +0000 (00:30 +0000)
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

index e8032b7..c1dd408 100644 (file)
@@ -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)