| base-4.1.0.0: Basic libraries | Source code | Contents | Index
Debug.Trace |
Portability | portable
Stability | provisional
Maintainer | libraries@haskell.org
Contents
Tracing
Description
The `trace` function.
Synopsis
putTraceMsg :: String -> IO ()
trace :: String -> a -> a
traceShow :: Show a => a -> b -> b
Tracing
putTraceMsg :: String -> IO () | Source
`putTraceMsg` function outputs the trace message from IO monad. 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.
trace :: String -> a -> a | Source
When called, `trace` outputs the string in its first argument, before returning the second argument as its result. The `trace` function is not referentially transparent, and should only be used for debugging, or for monitoring execution. Some implementations of `trace` may decorate the string that's output to indicate that you're tracing. The function is implemented on top of `putTraceMsg`.
traceShow :: Show a => a -> b -> b | Source
Like `trace`, but uses `show` on the argument to convert it to a `String`.
     traceShow = trace . show
Produced by Haddock version 2.4.2