trace -package:streamly -package:base-prelude

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.
Compute the trace of a matrix
>>> trace (V2 (V2 a b) (V2 c d))
a + d
Compute the trace of a matrix
>>> trace (V2 (V2 a b) (V2 c d))
a + d
Output a debug message to sterr, using trace, if tracing is enabled. Note: this writes to stderr even in pure instances.
apply a trace arrow and issue message to stderr
Warning: trace remains in code
Lens onto the Trace of a QDiagram.
Log a message.
Warning: trace remains in code
Warning: Trace statement left in code
Internally log what occurred. Log will be re-played on failure.
see trace
Sum of the elements in the diagonal. See also getDiag. Example:
( 1 2 3 )
( 4 5 6 )
trace ( 7 8 9 ) = 15
Warning: Leaving traces in the code
Lens onto the Trace of a QDiagram.
Warning: trace remains in code
Append a message to the trace log.
Deprecated: Don't leave me in the code
Print a string as a trace.
A trace for the X monad. Logs a string to stderr. The result may be found in your .xsession-errors file