>>> 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.
>>> trace (V2 (V2 a b) (V2 c d)) a + d
( 1 2 3 ) ( 4 5 6 ) trace ( 7 8 9 ) = 15
>>> Stream.drain $ Stream.trace print (Stream.enumerateFromTo 1 2) 1 2Compare with tap.
>>> s = Stream.enumerateFromTo 1 2 >>> Stream.fold Fold.drain $ Stream.trace print s 1 2Compare with tap.