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.
The traceIO function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.
Like traceShow but returns the shown value instead of a third value.
>>> traceShowId (1+2+3, "hello" ++ "world")
(6,"helloworld")
(6,"helloworld")