On Sun, Sep 27, 2009 at 12:50 PM, Paul Moore <[email protected]> wrote: > The problem is that I have *no idea* how to begin debugging this. In > C, Python, or any other imperative language, I'd put traces in, etc. > But in Haskell, I don't even know where to start. >
One of the standard modules is Debug.Trace module, which does allow you to print information to the console. It just may come in an odd order and of course, it can change your program if you force evaluation. Under the covers it is really "unsafePerformIO $ putStrLn msg", i.e., it just prints to the console. I've found that forcing a flush on the output stream can be useful too, so I've defined my own trace before too. There is also the GHC debugger, which is best described in the user manual - read the section there to learn more. If you hadn't already received help on the list, either of these could be used to narrow down where the crash is occurring. Justin _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
