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
#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
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