X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Futils%2FUtil.lhs;h=01a293dcbd3b3762cc0fda037aa3a5e8f3e76d0c;hp=ec5070f26a637a838a9d8c86b881a9ab23b85b84;hb=b00e3a6c0a82a8af3238d677f798d812cd7fd49f;hpb=00022894bbb2dfa33fd213eedbac0f28b4c4b7b4 diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index ec5070f..01a293d 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 @@ -815,7 +816,7 @@ looksLikeModuleName [] = False looksLikeModuleName (c:cs) = isUpper c && go cs where go [] = True go ('.':cs) = looksLikeModuleName cs - go (c:cs) = (isAlphaNum c || c == '_') && go cs + go (c:cs) = (isAlphaNum c || c == '_' || c == '\'') && go cs \end{code} Akin to @Prelude.words@, but acts like the Bourne shell, treating @@ -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 @@ -1019,11 +1020,3 @@ abstractDataType :: String -> DataType abstractDataType n = mkDataType n [abstractConstr n] \end{code} -\begin{code} --- Old GHC versions come with a base library with this function misspelled. -#if __GLASGOW_HASKELL__ < 612 -mkNoRepType :: String -> DataType -mkNoRepType = mkNorepType -#endif -\end{code} -