[C2hs] Re: Default Marshallers / Arbitrary expressions as marshallers

Gour gour at mail.inet.hr
Mon Oct 13 13:38:52 EDT 2008

>>>>> "Benedikt" == Benedikt Huber <benjovi at gmx.net> writes:

Hi Benedikt!

Benedikt> This sounds interesting, but I wonder which would be the most
Benedikt> sensible implementation strategy.  Do you suggest to implement
Benedikt> hs98 expressions using the existing framework ? Is there some
Benedikt> existing code that could be reused ?

I'm glad you're interested for this ticket.

Have you tried to implement something?

Benedikt> a) If the hs type is defined in an {# enum ... #} hook and the
Benedikt> C type is integral, use (fromEnum/toEnum . cIntConv) as
Benedikt> default.

It sounds good to me.

Benedikt> b) If the hs type and C type match, and are of the form (Ptr
Benedikt> a), use id' as default. This is really useful when working
Benedikt> with opaque pointers, but maybe there are type-safety related
Benedikt> reasons why this shouldn't be done.

Cannot comment on this one.

Benedikt> c) Additionally, we could allow the user to add other default
Benedikt> marshallers, depending on the combination of hs/C type. If I
Benedikt> recall correctly, Duncan had some ideas for this one ?

It seems I missed those...



Gour  | Zagreb, Croatia  | GPG key: C6E7162D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/c2hs/attachments/20081013/a5258548/attachment-0001.bin

More information about the C2hs mailing list