On 18/01/2011 22:22, Edward Z. Yang wrote:
Johan Tibell and I discovered what we're pretty sure is a bug in
the newArray# docs, in that it claims that it accepts a byte count,
not a word count. This appears to be falsified by GHC.Prim
as well as the actual implementation in C--:
unsafeArray b ies = unsafeArray' b (rangeSize b) ies
unsafeArray' (l,u) n@(I# n#) ies = runST (ST $ \s1# ->
case newArray# n# arrEleBottom s1# of
and
stg_newArrayzh
{
W_ words, n, init, arr, p, size;
/* Args: R1 = words, R2 = initialisation value */
Cheers,
Edward
1 patch for repository http://darcs.haskell.org/ghc:
Tue Jan 18 22:18:34 GMT 2011 Edward Z. Yang<[email protected]>
* Fix documentation bug: newArray# accepts word count, not byte count.
Thanks, I'll push.
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc