trace -package:base is:exact -package:base-prelude
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
Warning: trace remains in code
Warning: Trace statement left in code
Internally log what occurred. Log will be re-played on failure.
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
Apply a monadic function to each element flowing through the stream
and discard the results.
>>> Stream.drain $ Stream.trace print (Stream.enumerateFromTo 1 2)
1
2
Compare with
tap.
Deprecated: Don't leave me in the code
Append a message to the trace log.
Warning: trace remains in code
Apply a monadic function to each element flowing through the stream
and discard the results.
>>> s = Stream.enumerateFromTo 1 2
>>> Stream.fold Fold.drain $ Stream.trace print s
1
2
Compare with
tap.