X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=Debug%2FTrace.hs;h=40915215c97534fdbc5e3ed67009b8dcb031fe6e;hb=b50e64c6f56695ce4c5b874e36c26db1c62be46e;hp=3e369f5e183c12f728ba0b1534276f33a0325310;hpb=66bcbe67b61d83cb01b6d2c876e7b06e034fba88;p=ghc-base.git diff --git a/Debug/Trace.hs b/Debug/Trace.hs index 3e369f5..4091521 100644 --- a/Debug/Trace.hs +++ b/Debug/Trace.hs @@ -28,7 +28,7 @@ import System.IO (hPutStrLn,stderr) #endif -- | 'putTraceMsg' function outputs the trace message from IO monad. --- Usually the output stream is 'stderr' but if the function is called +-- Usually the output stream is 'System.IO.stderr' but if the function is called -- from Windows GUI application then the output will be directed to the Windows -- debug console. putTraceMsg :: String -> IO () @@ -56,3 +56,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