[Haskell-cafe] how do you debug programs?

Donald Bruce Stewart dons at cse.unsw.edu.au
Wed Sep 6 05:40:21 EDT 2006

> Hi Tamas
> There are several ways to debug a Haskell program.
> The most advanced ones are based in offline analysis of traces, I
> think Hat [1] is the most up-to-date tool for this. There is a Windows
> port of Hat at [5].
> Another approach is to simply use Debug.Trace. A more powerful
> alternative for this approach is Hood [2]. Even if it hasn't been
> updated in some time, Hood works perfectly with the current ghc
> distribution. Even more, Hugs has it already integrated [3]. You can
> simply import Observe and use observations directly in your program.
> For instance:
> import Observe
> f' = observe "f" f
> f a b = ....
> And then in hugs the expression:
> >f' 1 2
> would output what you want.
> Finally, the GHCi debugger project [4] aims to bring dynamic
> breakpoints and intermediate values observation to GHCi in a near
> future. Right now the tool is only available from the site as a
> modified version of GHC, so unfortunately you will have to compile it
> yourself if you want to try it.

Pepe, would you like to put up a page on the haskell.org wiki about
debugging in Haskell? You could use the above mail as a start :)

-- Don

More information about the Haskell-Cafe mailing list