Shared publicly  - 
 
Making it a little easier to get a stack trace: Debug.Trace.traceStack
26
4
Andy Gill's profile photoSimon Marlow's profile photo
3 comments
 
This is great Simon!

Are you planning on having the pattern match compiler fails use the stack trace information in error messages? Or calls to error?
 
+Andy Gill it's a bit tricky. Usually calls to error end up in CAFs because GHC lifts them to the top level, and then the stack you get is not useful. There is an RTS flag to dump a stack trace when an exception is thrown: +RTS -xc, and in 7.4.1 I've beefed this up a bit so that if the stack ends in a CAF it tries to find the stack of the caller and print that too. I don't know if/how we should expose this through a Haskell API.
Add a comment...