import Exception ( throwDyn )
#if __GLASGOW_HASKELL__ > 408
-import Exception ( catch )
+import qualified Exception ( catch )
#else
import Exception ( catchAllIO )
-#define catch catchAllIO
#endif
import IO
import Directory ( doesFileExist, removeFile )
import System ( system )
#endif
+
#include "HsVersions.h"
+-- Make catch work on older GHCs
+#if __GLASGOW_HASKELL__ > 408
+myCatch = Exception.catch
+#else
+myCatch = catchAllIO
+#endif
+
\end{code}
("Deleting: " ++ unwords fs)
(mapM_ rm fs)
where
- rm f = removeFile f `catch`
+ rm f = removeFile f `myCatch`
(\_ignored ->
when (verb >= 2) $
hPutStrLn stderr ("Warning: deleting non-existent " ++ f)
; unless n $ do {
-- And run it!
- ; action `catch` handle_exn verb
+ ; action `myCatch` handle_exn verb
}}
where
handle_exn verb exn = do { when (verb >= 2) (hPutStr stderr "\n")