From 1b5e16cc1383c9116b03653ff27a59bd55080e3d Mon Sep 17 00:00:00 2001 From: simonmar <unknown> Date: Thu, 3 Jun 1999 08:18:15 +0000 Subject: [PATCH] [project @ 1999-06-03 08:18:15 by simonmar] Fix bug in compat version of bracket. --- ghc/compiler/utils/Util.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs index 5b4200b4db27..c9b188330c0a 100644 --- a/ghc/compiler/utils/Util.lhs +++ b/ghc/compiler/utils/Util.lhs @@ -768,7 +768,8 @@ f $! x = x `seq` f x bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c bracket before after thing = do a <- before - (thing a) `catch` (\err -> after a >>= fail err) + r <- (thing a) `catch` (\err -> after a >> fail err) after a + return r #endif \end{code} -- GitLab