use '==' consistently rather than '->' in examples
[ghc-base.git] / Debug / Trace.hs
index 4091521..742044e 100644 (file)
 -----------------------------------------------------------------------------
 
 module Debug.Trace (
-       -- * Tracing
-       putTraceMsg,      -- :: String -> IO ()
-       trace             -- :: String -> a -> a
+        -- * Tracing
+        putTraceMsg,      -- :: String -> IO ()
+        trace,            -- :: String -> a -> a
+        traceShow
   ) where
 
 import Prelude
@@ -40,7 +41,10 @@ putTraceMsg msg = do
      withCString msg  $ \cmsg ->
       debugBelch cfmt cmsg
 
-foreign import ccall unsafe debugBelch :: CString -> CString -> IO ()
+-- don't use debugBelch() directly, because we cannot call varargs functions
+-- using the FFI.
+foreign import ccall unsafe "HsBase.h debugBelch2"
+   debugBelch :: CString -> CString -> IO ()
 #endif
 
 {-# NOINLINE trace #-}