On Mon, Nov 12, 2012 at 5:15 AM, Richard Eisenberg <<a href="mailto:eir@cis.upenn.edu">eir@cis.upenn.edu</a>> wrote:<br>><br>> I've recently used the conveniently-typed (pprTrace :: String -> SDoc -> a -> a) for this purpose. You have to compile with -DDEBUG, but it works great.<br>
><br>> Richard<br><br>To use pprTrace you don't actually need to compile with -DDEBUG, it only checks if -dno-debug-output has been specified on the command line:<br><a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/Outputable.html#pprTrace">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/Outputable.html#pprTrace</a><br>
<a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/StaticFlags.html#opt_NoDebugOutput">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/StaticFlags.html#opt_NoDebugOutput</a><br><div><br></div>
<div>Cheers,</div><div>Michal</div>