[project @ 2002-12-23 13:33:16 by malcolm]
[haskell-directory.git] / Debug / Trace.hs
index ecaf39e..19e8ac6 100644 (file)
@@ -26,6 +26,10 @@ import GHC.IOBase
 import GHC.Handle
 #endif
 
+#ifdef __HUGS__
+import Hugs.IOExts
+#endif
+
 #ifdef __GLASGOW_HASKELL__
 {-# NOINLINE trace #-}
 {-|
@@ -46,3 +50,8 @@ trace string expr = unsafePerformIO $ do
 
 foreign import ccall "PostTraceHook" postTraceHook :: Int -> IO ()
 #endif
+
+#ifdef __NHC__
+trace :: String -> a -> a
+trace str expr = unsafePerformIO $ do hPutStr stderr str; return expr
+#endif