projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
271884f
)
Generalise the type of onException
author
Ian Lynagh
<igloo@earth.li>
Sun, 3 Aug 2008 00:30:01 +0000
(
00:30
+0000)
committer
Ian 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
patch
|
blob
|
history
diff --git
a/Control/Exception.hs
b/Control/Exception.hs
index
e8032b7
..
c1dd408
100644
(file)
--- 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)