error stack traces/source locations (was: Should exhaustiveness testing be on by default?)

Simon Peyton-Jones simonpj at
Tue May 26 09:58:31 EDT 2009

| I'd be happy to be proven wrong in this, of course!-) I had the feeling
| that there'd been some recent work on all this and, indeed, reddit has:
| hc_pdf/

Sorry I've been very buried recently.  Some brief rejoinders to this thread.

- Yes, Tristan's paper "Finding the needle"
  describes his intern work, and represents a good stab at the problem.
  I think he'd be very interested in feedback.  Is this the best way to tackle
  the problem?  Are there better alternatives?

- It's not in GHC HEAD, because of the unresolved issues that are discussed
  towards the end of the paper.

- Template Haskell does let you find the current source location, thus:
   loc :: Q Exp
   loc = do { l <- location
            ; lift (loc_module l ++ ":" ++ show (loc_start l)) }
  Now you can say (error $(loc)), and you'll get the source location of the
  call to $loc.

  So that's pretty close to what was originally asked for.


More information about the Glasgow-haskell-users mailing list