<div dir="ltr">Hearty +1 one to this. Note:<div><br></div><div><font face="monospace, monospace">

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><font face="monospace, monospace">traceShowId = traceWith id</font></div>traceShow   = traceWith . const</font></div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div><br></div></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 9, 2018 at 5:08 PM, Kris Nuttycombe <span dir="ltr"><<a href="mailto:kris.nuttycombe@gmail.com" target="_blank">kris.nuttycombe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
<br>______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>