, win32ConsoleHandler
, toWin32ConsoleEvent
#endif
+ , reportError, reportStackOverflow
) where
import System.Posix.Types
import Foreign
import Foreign.C
-#ifndef __HADDOCK__
-import {-# SOURCE #-} GHC.TopHandler ( reportError, reportStackOverflow )
-#endif
-
import Data.Maybe
import GHC.Base
import GHC.STRef
import GHC.Show ( Show(..), showString )
import Data.Typeable
+import GHC.Err
+import Control.Exception hiding (throwTo)
infixr 0 `par`, `pseq`
\end{code}
#endif
+reportStackOverflow :: IO a
+reportStackOverflow = do callStackOverflowHook; return undefined
+
+reportError :: SomeException -> IO a
+reportError ex = do
+ handler <- getUncaughtExceptionHandler
+ handler ex
+ return undefined
+
+-- SUP: Are the hooks allowed to re-enter Haskell land? If so, remove
+-- the unsafe below.
+foreign import ccall unsafe "stackOverflow"
+ callStackOverflowHook :: IO ()
\end{code}
exit 1
-reportStackOverflow :: IO a
-reportStackOverflow = do callStackOverflowHook; return undefined
-
-reportError :: SomeException -> IO a
-reportError ex = do
- handler <- getUncaughtExceptionHandler
- handler ex
- return undefined
-
--- SUP: Are the hooks allowed to re-enter Haskell land? If so, remove
--- the unsafe below.
-foreign import ccall unsafe "stackOverflow"
- callStackOverflowHook :: IO ()
-
-- try to flush stdout/stderr, but don't worry if we fail
-- (these handles might have errors, and we don't want to go into
-- an infinite loop).