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

Generate (optional) instances for generated types #307

Open
edsko opened this issue Nov 28, 2024 · 2 comments
Open

Generate (optional) instances for generated types #307

edsko opened this issue Nov 28, 2024 · 2 comments

Comments

@edsko
Copy link
Collaborator

edsko commented Nov 28, 2024

We should automatically derive things like Eq, Ord, etc. for the types we generate (structs, enums, typedefs, ..). However, as part of #173 we discussed the importance of using Haskell newtype rather than type to translate C typedefs: we should be able to provide different instances. This implies it must also be possible to prevent hs-bindgen from generating instances for specific types (note that rust bindgen also has features for preventing the derivation of certain classes, see #21).

@edsko edsko added this to the 1: `Storable` instances milestone Nov 28, 2024
@edsko
Copy link
Collaborator Author

edsko commented Nov 28, 2024

The set of instances we should derive automatically will probably depend on the type (Num for example makes sense only for numeric types).

@edsko edsko changed the title Generate optional instances for generated types Generate (optional) instances for generated types Nov 28, 2024
@edsko
Copy link
Collaborator Author

edsko commented Nov 28, 2024

Related also #308.

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

No branches or pull requests

1 participant