[Haskell-cafe] Handling custom types in Takusen
Salvatore Insalaco
kirby81 at gmail.com
Fri Jul 27 11:27:45 EDT 2007
2007/7/27, Bayley, Alistair <Alistair_Bayley at invescoperpetual.co.uk>:
> It was my intention to do it the other way around: marshall blob to Ptr
> (), and then you can cast this to a Ptr CChar. Obviously you'd need to
> retain the size information, so a blob basically becomes a (Ptr (), Int)
> pair, just like a CStringLen...
>
> At least this way you've got a type which says explicitly "this thing is
> a blob", and then if you know better, i.e. it's really a CString, you
> can cast it.
You're right, I'll work in this direction. Eventually I will add also
the CStringLen marshalling, as it is a pretty common case (BS, FPS,
PS) and it could be handy.
Salvatore
More information about the Haskell-Cafe
mailing list