trace package:streamly-core

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.
Apply a monadic function to each element flowing through and discard the results.
>>> Stream.fold (Fold.trace print Fold.drain) $ (Stream.enumerateFromTo (1 :: Int) 2)
1
2
>>> trace f = Fold.lmapM (Fold.tracing f)
Pre-release
Perform a side effect before yielding each element of the stream and discard the results.
>>> s = Stream.enumerateFromTo 1 2

>>> Stream.fold Fold.drain $ Stream.trace_ (print "got here") s
"got here"
"got here"
Same as intersperseMPrefix_ but always serial. See also: trace Pre-release