X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FUtil.lhs;h=5d847213cc5287057865a9ab60ee0f8c7a08d135;hb=81466110ff8104ca60e20d617bab83f6f78f0ec2;hp=1b2a44dea1fa5c1ad9ddee6fe80437d8bc29ee02;hpb=e761a777f2440ca1b8d8b40848cc5aa30d889ff6;p=ghc-hetmet.git diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 1b2a44d..5d84721 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -6,7 +6,7 @@ \begin{code} module Util ( - debugIsOn, ghciTablesNextToCode, picIsOn, + ghciSupported, debugIsOn, ghciTablesNextToCode, picIsOn, isWindowsHost, isWindowsTarget, isDarwinTarget, -- general list processing @@ -65,8 +65,6 @@ module Util ( doesDirNameExist, modificationTimeIfExists, - later, handleDyn, handle, - -- Filename utils Suffix, splitLongestPrefix, @@ -79,9 +77,6 @@ module Util ( import Panic -import Control.Exception ( Exception(..), finally, catchDyn, throw ) -import qualified Control.Exception as Exception -import Data.Dynamic ( Typeable ) import Data.IORef ( IORef, newIORef ) import System.IO.Unsafe ( unsafePerformIO ) import Data.IORef ( readIORef, writeIORef ) @@ -107,11 +102,18 @@ infixr 9 `thenCmp` %************************************************************************ %* * -\subsection{Is DEBUG on, are we on Windows?} +\subsection{Is DEBUG on, are we on Windows, etc?} %* * %************************************************************************ \begin{code} +ghciSupported :: Bool +#ifdef GHCI +ghciSupported = True +#else +ghciSupported = False +#endif + debugIsOn :: Bool #ifdef DEBUG debugIsOn = True @@ -816,20 +818,6 @@ doesDirNameExist fpath = case takeDirectory fpath of "" -> return True -- XXX Hack _ -> doesDirectoryExist (takeDirectory fpath) --- ----------------------------------------------------------------------------- --- Exception utils - -later :: IO b -> IO a -> IO a -later = flip finally - -handleDyn :: Typeable ex => (ex -> IO a) -> IO a -> IO a -handleDyn = flip catchDyn - -handle :: (Exception -> IO a) -> IO a -> IO a -handle h f = f `Exception.catch` \e -> case e of - ExitException _ -> throw e - _ -> h e - -- -------------------------------------------------------------- -- check existence & modification time at the same time