This module exposes some useful tracing functions that should have been exported by Debug.Trace.
Feel free to copy&paste these functions into modules that need them, that may be easier to remove/clean up than adding a cabal dependency.
Generate an identity function that has the side-effect of showing the value that passes through it.
traceId "x,y = " (x, y)
|:: Show b|
|=> (a -> b)|
Function to preprocess the value before showing it
Prefix string to use before showing the result value
Generate an identity function that has the side-effect of tracing the value that passes through it by first processing it and then showing the result.
traceIdVia (take 5) "First 5 sorted elements of: " result
fmap (traceIdVia objName "The object we got") . receiveObject