No reason for Handler and catches to exclude nhc98.
[ghc-base.git] / Control / OldException.hs
index dd26167..afa4492 100644 (file)
@@ -135,21 +135,22 @@ import GHC.Base
 import GHC.Num
 import GHC.Show
 import GHC.IOBase ( IO )
-import GHC.IOBase (block, unblock, evaluate, catchException, throwIO)
 import qualified GHC.IOBase as ExceptionBase
 import qualified GHC.IOBase as New
-import GHC.Exception hiding ( Exception )
-import {-# SOURCE #-} GHC.Conc
+import GHC.Conc hiding (setUncaughtExceptionHandler,
+                        getUncaughtExceptionHandler)
 import Data.IORef       ( IORef, newIORef, readIORef, writeIORef )
 import Foreign.C.String ( CString, withCString )
-import {-# SOURCE #-} GHC.Handle       ( stdout, hFlush )
+import GHC.Handle       ( stdout, hFlush )
 #endif
 
 #ifdef __HUGS__
-import Hugs.Exception   as ExceptionBase
+import Prelude          hiding (catch)
+import Hugs.Prelude     as New (ExitCode(..))
 #endif
 
 import qualified Control.Exception as New
+import           Control.Exception ( throw, SomeException, block, unblock, evaluate, throwIO )
 import System.IO.Error  hiding ( catch, try )
 import System.IO.Unsafe (unsafePerformIO)
 import Data.Dynamic
@@ -396,7 +397,7 @@ catchDyn :: Typeable exception => IO a -> (exception -> IO a) -> IO a
 #ifdef __NHC__
 catchDyn m k = m        -- can't catch dyn exceptions in nhc98
 #else
-catchDyn m k = catchException m handle
+catchDyn m k = New.catch m handle
   where handle ex = case ex of
                            (DynException dyn) ->
                                 case fromDynamic dyn of
@@ -720,11 +721,11 @@ data Exception
 INSTANCE_TYPEABLE0(Exception,exceptionTc,"Exception")
 
 nonTermination :: SomeException
-nonTermination = toException NonTermination
+nonTermination = New.toException NonTermination
 
 -- For now at least, make the monolithic Exception type an instance of
 -- the Exception class
-instance ExceptionBase.Exception Exception
+instance New.Exception Exception
 
 instance Show Exception where
   showsPrec _ (IOException err)          = shows err