IF_NOT_GHC(cfst COMMA applyToPair COMMA applyToFst COMMA)
IF_NOT_GHC(applyToSnd COMMA foldPair COMMA)
unzipWith
+
+ -- I/O
+#if __GLASGOW_HASKELL__ < 402
+ , bracket
+#endif
+
) where
#include "HsVersions.h"
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}