Request: withArrayLength

Sven Panne Sven.Panne at
Mon Mar 22 13:55:51 EST 2004

Once upon a time, I wrote:
> Adrian Hey wrote:
>> [...] I think..
>>  withArrayLength :: Storable a => [a] -> (Ptr a -> Int -> IO b) -> IO b
>> would be useful because you often need the length in a foreign function
> I would support that, similar situations happened a few times in my
> OpenGL/GLUT stuff.
>> and I guess withArray must pre-calculate the length before allocating
>> storage in any case [...]
> Yep.

There has been no other response yet, so I'd like to raise this issue again.
If we decide to add this to the module, it should be documented in the FFI
addendum as well, BTW. Any opionions?


More information about the FFI mailing list