GHC 6.8.1 RC debugger only breaking on first evaluation of a function

Stefan O'Rear stefanor at
Tue Sep 18 16:51:34 EDT 2007

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. ;-)

There is a flag to do this, and it's even In The Manual!

  3.8.1. GHCi options

   GHCi options may be set using :set and unset using :unset.

   The available GHCi options are:


           Normally, any evaluation of top-level expressions (otherwise known
           as CAFs or Constant Applicative Forms) in loaded modules is
           retained between evaluations. Turning on +r causes all evaluation
           of top-level expressions to be discarded after each evaluation
           (they are still retained during a single evaluation).

           This option may help if the evaluated top-level expressions are
           consuming large amounts of space, or if you need repeatable
           performance measurements.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url :

More information about the Glasgow-haskell-users mailing list