
I agree with Grzegorz. Perhaps we should file a bug-report, if there
isn't one already?
-Iavor
2009/9/24 Grzegorz Chrupała
2009/9/23 Bulat Ziganshin
: Hello Grzegorz,
Wednesday, September 23, 2009, 7:19:59 PM, you wrote:
This seems like a bug in the implementation of writeArray: when passed let (l,u) = ((0,10),(20,20))
writeArray computes raw index (from 0 to total number of array elements) and check that this index is correct. with multi-dimensional arrays this approach may lead to wrong results, as you mentioned. it's known problem that isn't fixed for a long time probably due to efficiency cautions.
Hmm, I understand that efficiency is an issue, but in that case shouldn't unsafe writing be provided by and unsafeWriteArray function, while writeArray does proper range checking?
Or at least this problem with writeArray should be clearly indicated in the documentation. I for one spent several hours debugging before finding out about this lack of proper range checks so it's not an imaginary problem.
-- Grzegorz _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe