GHCi Debugger (was Re: [Haskell-cafe] Architecturally flawed)

Thomas M. DuBuisson thomas.dubuisson at
Thu Jul 10 23:16:39 EDT 2008

> I could try GHC's new debugger. But my experiences with it so far have 
> shown that for all but the most trivial programs possible, it becomes 
> intractably difficult to figure out what the debugger is actually 
> showing you. 

GDB is to C as
(a) GHCi debugger :: Haskell
(b) Pigs :: Farmers
(c) Food :: TomMD
(d) None of the above

Hint: Its not (a).  The GHCi debugger seems to catch extra flack because
people want to pour through their Haskell code as they do imperative
code.  I can sympathize - I would like to do that too - but it would be
an inaccurate picture of the programs execution.  so long as you regard
the GHCi as a new/useful tool and not try to pretend its like other
debuggers you'll probably be happier.

I've found ghcid to be useful when quickcheck + HPC + ChasingBottoms
fails to narrow down the problem any further.  Its gotten to the point
where I often know exactly which LOC/module will be the next step (based
on knowledge of the data dependencies).  A fair share of bugs have
fallen to the sword named vim as a result :-).  It really is useful, but
like all other haskellisms, one must learn to ride a bike all over

At times I think of ghcid as the anti-gdb.  If there's a series of let
bindings, each mutating the predecessor, its enjoyable to see the
debugger start at the bottom and crawl its way back up.


More information about the Haskell-Cafe mailing list