Warning police: Make some prototypes from the RTS known
[ghc-base.git] / Debug / Trace.hs
index 84de4d6..accf247 100644 (file)
@@ -40,7 +40,8 @@ putTraceMsg msg = do
      withCString msg  $ \cmsg ->
       debugBelch cfmt cmsg
 
-foreign import ccall unsafe debugBelch :: CString -> CString -> IO ()
+foreign import ccall unsafe "RtsMessages.h debugBelch"
+   debugBelch :: CString -> CString -> IO ()
 #endif
 
 {-# NOINLINE trace #-}
@@ -56,3 +57,11 @@ trace :: String -> a -> a
 trace string expr = unsafePerformIO $ do
     putTraceMsg string
     return expr
+
+{-|
+Like 'trace', but uses 'show' on the argument to convert it to a 'String'.
+
+> traceShow = trace . show
+-}
+traceShow :: (Show a) => a -> b -> b
+traceShow = trace . show