[C2hs] Custom default marshalers + binding variables

Maciej Piechotka uzytkownik2 at gmail.com
Sat Aug 29 05:23:45 EDT 2009

Hello. First I'd like to thank for great job c2hs is doing. However I
find a few points where it could be better.

1. New marshallers. Sometimes pointer + defaults are not good enough.
Maybe something like

{#marshaller cname [into hname] in='hname[-*]' out='hname[-*]#}

would be helpful.

Possibly overriding default marshallers would also be helpful (for
example if string is encoded in UTF-8).

2. Most of the C2HS library can be done as default elements. What's the
point of defining cIntConv as fromIntegral? Why not simply not insert
fromIntegral or Prelude.fromIntegral?

3. I find that many times I'd like to insert a simply variable into
argument. So I find out that:

{#fun ... {
	withNullPtr- `Ptr ...',
	} -> ...#}
	where withNullPtr f = f nullPtr

I guess that 

{#fun ... {
	nullPtr% `Ptr ...',
	} -> ...#}
or similar or

{#fun ... {
	($nullPtr)- `Ptr ...'
	} -> ...#}

would be helpful (the second notation allows any arbitrary Haskell
function to be executed which is also usefult.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/c2hs/attachments/20090829/fb24ef01/attachment.bin

More information about the C2hs mailing list