Request: withArrayLength

Sven Panne Sven.Panne at aedion.de
Thu Feb 12 12:26:09 EST 2004


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.

Cheers,
    S.



More information about the FFI mailing list