Haskell Hierarchical Libraries (base package)ContentsIndex
Debug.Trace
Portability portable
Stability provisional
Maintainer libraries@haskell.org
Contents
Tracing
Tracers
Messages
Description
The trace function.
Synopsis
fileTracer :: Handle -> String -> IO ()
addTracer :: String -> (String -> IO ()) -> IO ()
removeTracer :: String -> IO ()
putTraceMsg :: String -> IO ()
trace :: String -> a -> a
Tracing
Tracers
The tracer is a function that monitors the trace messages.
fileTracer
:: Handlefile handle
-> Stringtrace message
-> IO ()
A tracer function that outputs the message to a file
addTracer
:: Stringthe tracer name
-> (String -> IO ())tracer
-> IO ()
Registering a new tracer
removeTracer :: String -> IO ()
Removing the tracer with the given name
Messages
putTraceMsg :: String -> IO ()
putTraceMsg function outputs the trace message from IO monad.
trace :: String -> a -> a
When called, trace outputs the string in its first argument using the installed tracers, 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.
Produced by Haddock version 0.6