finally, -- :: IO a -> IO b -> IO a
+#ifdef __GLASGOW_HASKELL__
setUncatchedExceptionHandler, -- :: (Exception -> IO ()) -> IO ()
getUncatchedExceptionHandler -- :: IO (Exception -> IO ())
+#endif
) where
#ifdef __GLASGOW_HASKELL__
import GHC.Conc ( throwTo, ThreadId )
import GHC.IOBase ( IO(..), IORef(..), newIORef, readIORef, writeIORef )
import GHC.Handle ( stdout, hFlush )
-import Foreign.C.String ( CString, withCStringLen )
#endif
#ifdef __HUGS__
import Hugs.Exception as ExceptionBase
#endif
+import Foreign.C.String ( CString, withCStringLen )
+
import Prelude hiding ( catch )
import System.IO.Error hiding ( catch, try )
import System.IO.Unsafe (unsafePerformIO)
#endif
+#ifdef __GLASGOW_HASKELL__
{-# NOINLINE uncatchedExceptionHandler #-}
uncatchedExceptionHandler :: IORef (Exception -> IO ())
uncatchedExceptionHandler = unsafePerformIO (newIORef defaultHandler)
getUncatchedExceptionHandler :: IO (Exception -> IO ())
getUncatchedExceptionHandler = readIORef uncatchedExceptionHandler
+#endif
\ No newline at end of file