[Haskell-cafe] Re: Block-wise lazy sequences in Haskell
benjamin.franksen at bessy.de
Fri Sep 7 18:18:01 EDT 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,
They are (indirectly), see
sizeOf :: a -> Int
Computes the storage requirements (in bytes) of the argument. The value of
the argument is not used.
sizeOf :: Storable a => a -> Int
alignment :: Storable a => a -> Int
The function sizeOf computes the storage requirements (in bytes) of the
argument, andalignment computes the alignment constraint of the argument.
An alignment constraint x is fulfilled by any address divisible by x. Both
functions do not evaluate their argument, but compute the result on the
basis of the type of the argument alone. [...]
More information about the Haskell-Cafe