how to convert an array of foreignPtr a into a list of Ptr a

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to convert an array of foreignPtr a into a list of Ptr a

PICCA Frederic-Emmanuel
Hello, I am writing some code whcih use FFI.

one of my C functions has an array of pointer has imput

extern HklBinocularsCube *hkl_binoculars_cube_new(int32_t n_spaces,
                                                                           const HklBinocularsSpace **spaces);


from Haskell, I have a list of ForeignPtr
so my question how can I have something like withForeignPtr for an array of ForeignPtr

[ForeignPtr a] -> ([Ptr a] -> IO b) -> IO b

Thanks for your help.

Frederic
_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners