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

Sourabh Kumar Sharma
  • 2,864
  • 3
  • 25
  • 33
blue-sky
  • 51,962
  • 152
  • 427
  • 752

1 Answers1

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.

fgv
  • 835
  • 8
  • 15
  • @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. – fgv Jul 24 '15 at 16:59