[Haskell-cafe] Big Arrays

John Millikin jmillikin at gmail.com
Mon Oct 4 10:55:07 EDT 2010


On Mon, Oct 4, 2010 at 01:51, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello John,
>
> Monday, October 4, 2010, 7:57:13 AM, you wrote:
>
>> Sure it does; a 32-bit system can address much more than 2**30
>> elements. Artificially limiting how much memory can be allocated by
>> depending on a poorly-specced type like 'Int' is a poor design
>> decision in Haskell and GHC.
>
> are you understand that the "poor design decision" makes array access
> several times faster and doesn't limit anything except for very rare huge
> Bool arrays?

I don't see how using 'Int' instead of 'Word' makes array access
"several times faster". Could you elaborate on that?

The important limited use case is an array of Word8 -- by using 'Int',
byte buffers are artificially limited to half of their potential
maximum size.


More information about the Haskell-Cafe mailing list