
26 Apr
2012
26 Apr
'12
3:50 a.m.
On 25/04/2012 17:28, Ozgur Akgun wrote:
Hi,
On 25 April 2012 16:36, Michael Snoyman
mailto:michael@snoyman.com> wrote: Prelude.head: empty list
Recent versions of GHC actually generate a very helpful stack trace, if the program is compiled with profiling turned on and run with -xc.
Right. Also don't forget to add -fprof-auto. There's an API to get access to the stack trace too: http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.5.0.0/GHC-Stack...
See: http://community.haskell.org/~simonmar/slides/HIW11.pdf (Ironically titled "Prelude.head: empty list")
A more recent talk about this with more details is here: http://community.haskell.org/~simonmar/Stack-traces.pdf Cheers, Simon