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

Rene de Visser rene_de_visser at
Tue Nov 8 07:08:45 EST 2005

>One idea that occurred to us recently is this: GHCi could provide a
>simplified version of the cost-centre-stack machinery *all the time*,


This still doesn't explain to me why

C:\Haskell\dev>main +RTS -xc


<GHC.Arr.CAF>main: Error in array index

(This is with full profiling turned on)

This sort of stack is not going to help anyone.

What I think would be good is the ability to compile the executable with a 
top level exeception handler which goes into a low level debugger where you 
can examine the thunk and its surroundings.

I presume that some type information is retained for the garbage collector? 
Enough to tell integers from pointers?


error "Error in array index" ++ internal_show_b b ++ internal_show_i i

could be done, which wouldn't have the problem of exporting unwanted show 


More information about the Glasgow-haskell-users mailing list