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

Generating PackageInfo_* files for dependencies to retire most usages of CPP. #10232

Open
Kleidukos opened this issue Jul 28, 2024 · 1 comment
Labels
type: enhancement type: RFC Requests for Comment

Comments

@Kleidukos
Copy link
Member

In order to avoid using CPP and messing with source tooling like formatters and linters, I'd like cabal to provide me with PackageInfo_* modules for my dependencies, so that I may use Template Haskell in order to provide different code snippets based on the version of my dependencies.

Basically, a Haskell rendition of cabal_macros.h, which could perhaps remain useful for use with FFI, but its CPP would not pollute Haskell source code anymore.

@Kleidukos Kleidukos added type: enhancement type: RFC Requests for Comment labels Jul 28, 2024
@Kleidukos
Copy link
Member Author

Just to mention that this would be in line with what cabal already offers to do implementation-conditional compilation (see https://github.com/Kleidukos/print-api/blob/main/print-api.cabal#L48-L55 and https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13076)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement type: RFC Requests for Comment
Projects
None yet
Development

No branches or pull requests

1 participant