[Haskell-cafe] Error in array index.
claus.reinke at talk21.com
Thu Jun 25 03:50:12 EDT 2009
> It's too bad that indexes are `Int` instead of `Word` under
> the hood. Why is `Int` used in so many places where it is
> semantically wrong? Not just here but also in list indexing...
> Indices/offsets can only be positive and I can't see any good
> reason to waste half the address space -- yet we encounter
> this problem over and over again.
Readers who disliked the above also disliked the following:
"index out of range" error message regression
Int / Word / IntN / WordN are unequally optimized
Arrays allow out-of-bounds indexes
Not to mention that many serious array programmers use their
own array libraries (yes, plural:-(, bypassing the "standard", so
their valuable experience/expertise doesn't result in improvements
in the standard array libraries (nor have they agreed on a new API).
If any of this is affecting your use of GHC or libraries, you might
want to add yourself to relevant tickets, or add new tickets. Small
bug fixes, alternative designs and grand array library reunification
initiatives might also be welcome.
PS. You could, of course, rebase your array indices to make
use of the negatives, so the address space isn't wasted, just
made difficult to use.
More information about the Haskell-Cafe