[Haskell-cafe] an array of pointers in FFI?

Galchin, Vasili vigalchin at gmail.com
Fri Aug 1 01:59:06 EDT 2008


Thanks Bulat! So since we are "talking" ;^) .... is there a function already
in Foreign that will allow me to ...

[a] -> Ptr (Ptr ()) i.e. map a list of type "a" to an array of ptrs of type
"a"?

Kind regards, Vasili

On Fri, Aug 1, 2008 at 12:53 AM, Bulat Ziganshin
<bulat.ziganshin at gmail.com>wrote:

> Hello Vasili,
>
> Friday, August 1, 2008, 9:08:05 AM, you wrote:
>
> >      Is a (Ptr (Ptr a)) a polymorphic representation of an array of
> > pointers of type "a"? I want to pass an array of pointers to a C
> function.
>
> use Ptr (Ptr ())
>
> Ptr ()  in haskell is like void* in C, it's used to represent pointer
> to arbitrary type. you can use castPtr to cast pointers between different
> types
>
>
> --
> Best regards,
>  Bulat                            mailto:Bulat.Ziganshin at gmail.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080801/07ca5325/attachment.htm


More information about the Haskell-Cafe mailing list