Reliability of trace?

Colin Paul Adams colin at
Tue Mar 10 11:14:40 EDT 2009

>>>>> "Isaac" == Isaac Dupree <ml at> writes:

    Isaac> Colin Paul Adams wrote:
    >> I'm trying to use Debug.Trace to debug some tree-walking that
    >> I've written.
    >> It seems to me that I am missing some traces on intermediate
    >> function calls. I guess that ghc is re-arranging the code in
    >> such a way that some of these intermediate calls
    >> disappear. Anyway of stopping this? I already specify -O0.

    Isaac> right; with -O0 you get pretty much the exact amount of
    Isaac> sharing that your code suggests

    Isaac> are you sure those traces are attached to expressions that
    Isaac> are being evaluated at all?  Remember how lazy Haskell
    Isaac> is...

I was was absolutely sure of what was happening, I wouldn't need to
run a trace :-).

But I do know certain things about what is happening, and I cannot see
how the code can avoid some of these trace statements.

Anyway, I think I know how to fix my code now. 
When I've done it, I'll put the traces back on, and see if I can
understand what is happening. If not, I'll post the code here, and ask
the question again, for future enlightenment.
Colin Adams
Preston Lancashire

More information about the Glasgow-haskell-users mailing list