How to use `trace` while debuging GHC

Michal Terepeta michal.terepeta at
Mon Nov 12 10:09:58 CET 2012

On Mon, Nov 12, 2012 at 5:15 AM, Richard Eisenberg <eir at>
> I've recently used the conveniently-typed (pprTrace :: String -> SDoc ->
a -> a) for this purpose. You have to compile with -DDEBUG, but it works
> Richard

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:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list