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

Supporting multiple versions of C headers #30

Open
georgefst opened this issue Nov 5, 2022 · 2 comments
Open

Supporting multiple versions of C headers #30

georgefst opened this issue Nov 5, 2022 · 2 comments

Comments

@georgefst
Copy link
Owner

I knew the day would come eventually, but 1369957 is the first time we've had to worry about this. Obviously, if we had to keep repeating the process used there, we'd quickly get an unmaintainable mess. But it's also total boilerplate, so we should be able to do better.

Could c2hs be patched to allow CPP within enum define blocks (and others?). Currently it causes a "lexical error". Alternatively, maybe it could do something smarter like just not generating the constructor if a constant isn't found. But bear in mind, we would sometimes still want to get warnings.

Otherwise, maybe we should just auto-generate Codes.chs in it's entirety (and drop c2hs?)?

We need to consider what our support policy is. Bear in mind it's mostly just me, and I don't dedicate a lot of time to maintaining this library.

@georgefst
Copy link
Owner Author

georgefst commented Oct 20, 2023

Perhaps generating a different type on different platforms is just a bad idea, and we should emit warnings instead: haskell/cabal#9292 (comment) (although there are objections slightly further down that thread).

@georgefst
Copy link
Owner Author

For downstream effects of this, see georgefst/monpad@b55cbb6.

Somewhat relatedly, at least since it involves limitations of auto-generation, see also georgefst/monpad@c548082. I'd prefer not to have had to change those, instead providing a manual FromDhall instance which accepts the synonyms, but if I'm to write all out in full, I want it to work for all platforms. Perhaps a Read instance in this library could be used as the basis for such things?

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