#endif
-- * Throwing exceptions
-#ifndef __HUGS__
+#ifdef __HUGS__
+ throwIO, -- :: Exception -> IO a
+#else
throw, -- :: Exception -> a
-#endif
ioError, -- :: Exception -> IO a
-#ifndef __HUGS__
throwTo, -- :: ThreadId -> Exception -> a
#endif
) where
#ifdef __GLASGOW_HASKELL__
-import Prelude hiding (catch)
import GHC.Base ( assert )
import GHC.Exception as ExceptionBase hiding (try, catch, bracket, bracket_)
import GHC.Conc ( throwTo, ThreadId )
#endif
#ifdef __HUGS__
-import Prelude hiding ( catch, ioError )
import Hugs.Exception hiding ( evaluate )
import qualified Hugs.Exception as ExceptionBase
#endif
+import Prelude hiding ( catch )
import System.IO.Error
import Data.Dynamic
-- 'catchJust', 'tryJust', or 'handleJust' to select certain common
-- classes of exceptions.
-ioErrors :: Exception -> Maybe IOError
#ifdef __GLASGOW_HASKELL__
+ioErrors :: Exception -> Maybe IOError
arithExceptions :: Exception -> Maybe ArithException
errorCalls :: Exception -> Maybe String
dynExceptions :: Exception -> Maybe Dynamic
assertions :: Exception -> Maybe String
asyncExceptions :: Exception -> Maybe AsyncException
-#endif /* __GLASGOW_HASKELL__ */
userErrors :: Exception -> Maybe String
-
-#ifdef __HUGS__
-ioErrors = justIoErrors
-userErrors = justUserErrors
-#endif
+#endif /* __GLASGOW_HASKELL__ */
#ifdef __GLASGOW_HASKELL__
ioErrors e@(IOException _) = Just e