Haskell and Maple FFI

Rafael Martinez Torres rmartine at fdi.ucm.es
Thu Oct 21 13:26:45 EDT 2004



>
>
> C) CInt, CDouble are available...but, concerning Storable class.
>
> Given:
> typedef struct _foostruct {
>     int a;
>     double b;
> } fooStruct, *fooStructPtr;
>
> How to do to marshall  it to Haskell ?
>
> type CFooStruct = ???
>
> instance Storable CFooStruct where
>    sizeOf _ = ???
>    peekElement _ = ????
>
> -- Next is certainly OK, provided well defined CFooStruct
> type CFoosStructPtr = Ptr CFooStruct
>

Well, after reading some doc, I realised it may not be  feasible
without a FFI preprocessor.

For the time beeing, as I don't want to access the internals of Kernel
descriptor, but to deal with it through the given API, I will declare

type MKernelDescriptor = Ptr ()

as a transient solution. It seems to be OK.



More information about the FFI mailing list