On Thu, 2009-09-24 at 13:53 +0200, Grzegorz Chrupała wrote: > 2009/9/23 Bulat Ziganshin <bulat.zigans...@gmail.com>: > > 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.
It's now fixed: http://hackage.haskell.org/trac/ghc/ticket/2120#comment:13 Duncan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe