[Haskell-cafe] Debugging Haskell code

Curt Sampson cjs at starling-software.com
Tue Sep 29 00:01:47 EDT 2009


On 2009-09-28 22:53 -0400 (Mon), John D. Ramsdell wrote:

> I've had great success debugging a large program by loading the Main
> module into ghci after setting GHC extensions, changing the search
> path, and setting break on errors.  If you then place calls to the
> error function at the right location, and trace the execution, you'll
> be able to get a stack trace of the context in which the error
> function was called.

Yes, I often use the interpreter to poke at and play with my code.

Note that by using the -odir and so forth options, you can mix interpreted
and compiled code, so that you need interpret only the particular modules
you're trying to debug, and all the rest the application can run at full,
compiled speed.

cjs
-- 
Curt Sampson       <cjs at starling-software.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com


More information about the Haskell-Cafe mailing list