[Haskell-cafe] How to catch error in array index when debugging

Claus Reinke claus.reinke at talk21.com
Sat Mar 14 06:54:12 EDT 2009


>> I'm getting a runtime failure "Error in array index". This causes ghci
>> to exit.
> 
>> Is there a way to get it to break instead, so I can find out which
>> function is failing?
> 
> i recall two techniques - one is trivially define your own (!) and
> print index at least. another is to use ghc profiling with -xc RTS
> option

None of which is satisfactory. You might also want to add yourself 
to this ticket:

    "index out of range" error message regression
    http://hackage.haskell.org/trac/ghc/ticket/2669

Claus



More information about the Haskell-Cafe mailing list