3

Is there a generic function (printCallStack) that will print the call stack of a recursive loop.

For example,

printCallStack(length ([7, 1 'quot' 0])) 

prints call stack :

enter image description here

1 Answer 1

3

It seems that you are looking for something like Hat, which is a source level tracer for haskell, and possibly specifically for hat-stack, which is the stack tracer component.

You can alternatively use the debugger/tracer built into ghci. Not as nice as hat, but doesn't require to recompile your code and it's readily available. In case you wonder, it's the :trace command in ghci.

Sign up to request clarification or add additional context in comments.

1 Comment

@mb14 Yes, in the past. However version 2.8.0.0 seems have problems to build cleanly on Windows due to an "unknown type name 'uint32_t" error message, in case this is the problem that you are seeing with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.