
On Tue, Sep 18, 2007 at 02:26:38PM -0400, Olivier Boudry wrote:
Hi all,
I just tried the new GHCi debugger. A great new feature of GHCi 6.8.1.
When debugging a function, as for example the qsort function given as an example in the "3.5 The GHCi Debugger" documentation page, the debugger will only break on first function evaluation.
As haskell is pure and lazy it's probably a normal behavior (reuse last result instead of recompute) but it's not very practical in a debugger. I tried to reload (:r) but it doesn't seems to help. Is there a way to force the function to be re-evalutated without quitting, starting, loading prog and setting breakpoints again, other than making the function part of the IO monad. ;-)
If you don't find a better solution, then at least you can make it easier to perform the above sequence: $ cat ~/.ghci :def . readFile $ cat script :l Module :b 236 $ ghci GHCi, version 6.8.20070912: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :. script [1 of 1] Compiling Module ( Module.hs, interpreted ) Ok, modules loaded: Module. Breakpoint 0 activated at Module.hs:236:20-45 *Module> _ It should be quite easy to go a step further and generate breakpoint locations from markers in comments in the source file. Best regards Tomek