<div dir="ltr">When using Debug.Trace for debugging, a very common operation is to prefer to trace only some subset or function of an intermediate result. As a consequence, I propose adding the following function to Debug.Trace:<div><br></div><div><div>traceWith :: (Show b) => (a -> b) -> a -> a</div><div>traceWith f a = trace (show $ f a) a</div><div><br></div></div><div>While it's trivial to define, I have found this to be one of the most useful functions in my trace-based debugging toolkit, hence my proposal that it be added to base. It generalizes `traceShowId` in a meaningful and useful fashion. </div><div><br></div><div>As this is the first such proposal I've put forth, please let me know if I'm doing anything wrong with it!</div><div><br></div><div>Thanks,</div><div><br></div><div>Kris Nuttycombe</div></div>