trace -package:streamly -package:shelly -package:pandoc package:hledger-lib

The trace function outputs the trace message given as its first argument, before returning the second argument as its result. For example, this returns the value of f x and outputs the message to stderr. Depending on your terminal (settings), they may or may not be mixed.
>>> let x = 123; f = show

>>> trace ("calling f with x = " ++ show x) (f x)
calling f with x = 123
"123"
The trace function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.
Trace (print to stderr) a string if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.
Trace (print to stderr) a showable value using a custom show function, if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.
The traceIO function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.
Log a string to the debug log before returning the second argument. Uses unsafePerformIO.
Log a string to the debug log before returning the second argument, if the global debug level is at or above the specified level. At level 0, always logs. Otherwise, uses unsafePerformIO.
Like traceLogAt, but convenient to use in IO.
Log a string to the debug log before returning the second argument, if the global debug level is at or above the specified level. At level 0, always logs. Otherwise, uses unsafePerformIO.
Like traceLog but sequences properly in IO.
Log a value to the debug log with the given show function before returning it.
Like traceShow but returns the shown value instead of a third value.
>>> traceShowId (1+2+3, "hello" ++ "world")
(6,"helloworld")
(6,"helloworld")
Trace a value with the given show function before returning it.
Trace to stderr or log to debug log the provided label (if non-null) and current parser state (position and next input). See also: Hledger.Utils.Debug, megaparsec's dbg. Uses unsafePerformIO.
Pretty-trace a showable value before returning it. Like Debug.Trace.traceShowId, but pretty-printing and easier to type.
Pretty-print a label and a showable value to the console if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.
Like ptraceAt, but convenient to insert in an IO monad and enforces monadic sequencing.
Pretty-log a label and showable value to the debug log, if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.
Like ptraceAt, but convenient to insert in an IO monad and enforces monadic sequencing.