Proposal: Improved error message of "Error in array index"

John Meacham john at
Tue Nov 8 18:52:40 EST 2005

On Tue, Nov 08, 2005 at 11:12:09AM -0000, Simon Marlow wrote:
> Nice - though it would be even better to provide the required
> functionality automatically.

I am not sure that is the case. I think library authors would be better
suited to provide meaningful error messages and decide when propegating
the srcloc would be useful. also, experienced haskell programs tend not
to write partial functions to begin with, relying on pattern matching
which is often more efficient and automatically gives a localized error
message on failure.

> One idea that occurred to us recently is this: GHCi could provide a
> simplified version of the cost-centre-stack machinery *all the time*,
> giving you a proper backtrace for any exception, at least for the parts
> of the call stack that are interpreted.  We don't care about the cost
> too much - interpreted code is a lot slower than compiled already, and
> it would only be a small constant factor.  I think this would be a huge
> win for debuggability.  And a nice project for anyone who wants to hack
> on the GHC internals - though not a small task by any means.

personally, I rarely find the stack dump very useful at all (though I
always have high hopes). perhaps I have just had bad experiences with
it, but it can often be uninformative or even misleading. 


John Meacham - ⑆⑆john⑈ 

More information about the Glasgow-haskell-users mailing list