Hello !
I've set up a branch of c2hs using Language.C's parser and pretty
printer.
> http://code.haskell.org/~bhuber/c2hs
The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small
bonus, implements "enum define" hooks (Bug #5).
best regards,
benedikt
Hi again,
I noted Gour filed a ticket for 'allowing arbitrary expressions as
marshallers'.
> http://hackage.haskell.org/trac/c2hs/ticket/13
This sounds interesting, but I wonder which would be the most sensible
implementation strategy.
Do you suggest to implement hs98 expressions using the existing
framework ? Is there some existing code that could be reused ?
Apart from that, I think the following additional default marshallers
would make sense:
a) If the hs type is defined in an {# enum ... #} hook and the C type
is integral, use (fromEnum/toEnum . cIntConv) as default.
b) If the hs type and C type match, and are of the form (Ptr a), use
'id' as default. This is really useful when working with opaque
pointers, but maybe there are type-safety related reasons why this
shouldn't be done.
c) Additionally, we could allow the user to add other default
marshallers, depending on the combination of hs/C type. If I recall
correctly, Duncan had some ideas for this one ?
best regards,
benedikt
On Wed, 2008-08-20 at 18:36 +0200, Benedikt Huber wrote:
> Hello !
>
> I've set up a branch of c2hs using Language.C's parser and pretty
> printer.
> > http://code.haskell.org/~bhuber/c2hs
> The branch also fixes a couple of bugs (#6,#8,#9,#12) and, as a small
> bonus, implements enum define hooks (Bug #5).
Woo hoo!
When you're happy we should merge this into mainline c2hs.
Which reminds me, I should fix #11.
Duncan