Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c2hs should derive and use default marshallers from enum and pointer hooks #31

Closed
ian-ross opened this issue Aug 1, 2013 · 0 comments
Closed

Comments

@ian-ross
Copy link
Member

ian-ross commented Aug 1, 2013

Bug imported from C2HS Trac

Trac ticket created: 2010-05-27T17:26:12-0700


This is a FIXME in the source code, and I'm working on bindings that would really benefit from the DRY aspect of this feature.

Specifically, c2hs should derive the following in/out marshallers:

  • fromIntegral . fromEnum and toEnum . fromIntegral from an enum hook
  • id and id from both naked and newtype pointer hooks
  • withForeignPtr and newForeignPtr_ for foreign pointer hooks
  • withPointerType (the generated function) and PointerType . newForeignPtr_ for foreign newtype pointer hooks. The out marshaller is not great here, a !ForeignPtr with no finalizers is not terribly useful concealed inside the newtype. Perhaps foreign newtype should be left naked, or furnished with an 'in' default marshaller only.

Since I don't enjoy giving work to other people, I volunteer to add this functionality and submit a patch. This ticket is created for tracking purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant