diff options
author | Ian Lynagh <igloo@earth.li> | 2010-12-18 21:33:50 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-12-18 21:33:50 +0000 |
commit | b00e3a6c0a82a8af3238d677f798d812cd7fd49f (patch) | |
tree | 221590400c93958028a5538f2767b6c2a2ab158c /compiler/utils | |
parent | 50769d7532f90b0ec1f1759a56d478cf2926a0ff (diff) | |
download | haskell-b00e3a6c0a82a8af3238d677f798d812cd7fd49f.tar.gz |
Replace uses of the old catch function with the new one
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Util.lhs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 55a1a4f566..01a293dcbd 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -86,6 +86,7 @@ module Util ( #include "HsVersions.h" +import Exception import Panic import Data.Data @@ -99,7 +100,7 @@ import FastTypes #endif import Control.Monad ( unless ) -import System.IO.Error as IO ( catch, isDoesNotExistError ) +import System.IO.Error as IO ( isDoesNotExistError ) import System.Directory ( doesDirectoryExist, createDirectory, getModificationTime ) import System.FilePath @@ -939,9 +940,9 @@ doesDirNameExist fpath = case takeDirectory fpath of modificationTimeIfExists :: FilePath -> IO (Maybe ClockTime) modificationTimeIfExists f = do (do t <- getModificationTime f; return (Just t)) - `IO.catch` \e -> if isDoesNotExistError e - then return Nothing - else ioError e + `catchIO` \e -> if isDoesNotExistError e + then return Nothing + else ioError e -- split a string at the last character where 'pred' is True, -- returning a pair of strings. The first component holds the string |