trace -package:matrix package:streamly

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.
Perform a side effect before yielding each element of the stream and discard the results.
>>> Stream.drain $ Stream.trace_ (print "got here") (Stream.enumerateFromTo 1 2)
"got here"
"got here"
Same as intersperseMPrefix_ but always serial. See also: trace Pre-release