import GHC.Handle
#endif
-#ifdef __HUGS__
-import Hugs.IOExts
-#endif
-
-#ifdef __GLASGOW_HASKELL__
{-# NOINLINE trace #-}
{-|
When called, 'trace' prints the string in its first argument to
trace string expr = unsafePerformIO $ do
hPutStr stderr string
hPutChar stderr '\n'
+#ifdef __GLASGOW_HASKELL__
fd <- withHandle_ "trace" stderr $ (return.haFD)
postTraceHook fd
+#endif
return expr
+#ifdef __GLASGOW_HASKELL__
foreign import ccall "PostTraceHook" postTraceHook :: Int -> IO ()
#endif