[Haskell-cafe] Block-wise lazy sequences in Haskell

Henning Thielemann lemming at henning-thielemann.de
Wed Sep 5 14:35:11 EDT 2007


On Wed, 5 Sep 2007, Bryan O'Sullivan wrote:

> Henning Thielemann wrote:
>
>>  I thought it must be possible to define an unboxed array type with 
>> Storable elements.
>
> Yes, this just hasn't been done.  There would be a few potentially tricky 
> corners, of course; Storable instances are not required to be fixed in size, 
> though all the precanned instances are.

I see. This could be solved with a StorableFixedSize class. But it hasn't 
been done, too, I assume.

>  Using arbitrary Storable instances would make it necessary to scan an 
> array linearly to get to a particular element, defeating one of the 
> advantages of e.g. ByteStrings.

I doubt that someone is interested in such an array implementation.

>> Further on, I wonder why pairs are not instances of Storable.
>
> I think it hasn't been done simply because it hasn't been done.

Maybe also because of the issue of varying sizes?


More information about the Haskell-Cafe mailing list