I don&#39;t know why people use trace this way instead of in the reverse form:<div><br></div><div>debug = flip trace</div><div><br></div><div>this way I can isolate debug code in the right  from normal code:</div><div><br>
</div><div><br></div><div>main= do</div><div>   a &lt;- getChar</div><div>   b &lt;- getChar                         `debug`  (&quot;a=&quot;++ show a)</div><div>   let c= a+b                            `debug`  (&quot;b=&quot;++ show b)</div>
<div>   ...</div><div>and so on.</div><div><br></div><div>I saw it for the first time in the DrIFt libtary.</div><div><br><br><div class="gmail_quote">2009/10/20 Justin Bailey <span dir="ltr">&lt;<a href="mailto:jgbailey@gmail.com">jgbailey@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">These woudl be much more useful if they flushed the output handle<br>
after each message. Then you know your trace messages will be<br>
displayed/written to a file.<br>
<div><div></div><div class="h5"><br>
On Mon, Oct 19, 2009 at 1:51 PM, Thomas Hartman &lt;<a href="mailto:tphyahoo@gmail.com">tphyahoo@gmail.com</a>&gt; wrote:<br>
&gt; I have this and a couple other handy functions in<br>
&gt;<br>
&gt; DebugTraceHelpers:<br>
&gt;<br>
&gt; <a href="http://patch-tag.com/r/tphyahoo/DebugTraceHelpers/snapshot/current/content/pretty" target="_blank">http://patch-tag.com/r/tphyahoo/DebugTraceHelpers/snapshot/current/content/pretty</a><br>
&gt;<br>
&gt; hackage:<br>
&gt;<br>
&gt; <a href="http://hackage.haskell.org/packages/archive/DebugTraceHelpers/0.12/doc/html/Debug-Trace-Helpers.html" target="_blank">http://hackage.haskell.org/packages/archive/DebugTraceHelpers/0.12/doc/html/Debug-Trace-Helpers.html</a><br>

&gt;<br>
&gt;<br>
&gt; 2009/10/16 Martijn van Steenbergen &lt;<a href="mailto:martijn@van.steenbergen.nl">martijn@van.steenbergen.nl</a>&gt;:<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I propose the addition of the following two functions to module Debug.Trace:<br>
&gt;&gt;<br>
&gt;&gt;&gt; traceM :: Monad m =&gt; String -&gt; m ()<br>
&gt;&gt;&gt; traceM msg = trace msg (return ())<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; traceShowM :: (Show a, Monad m) =&gt; a -&gt; m ()<br>
&gt;&gt;&gt; traceShowM = traceM . show<br>
&gt;&gt;<br>
&gt;&gt; These functions allow tracing in any do-block. I often define them myself; I<br>
&gt;&gt; think they are useful in general.<br>
&gt;&gt;<br>
&gt;&gt; Deadline: 23 October 2009.<br>
&gt;&gt;<br>
&gt;&gt; Martijn.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Libraries mailing list<br>
&gt;&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>