MIN_VERSION macros

David Feuer david.feuer at gmail.com
Fri Sep 25 16:06:22 UTC 2015


Cabal defines MIN_VERSION_* macros that allow CPP in a Haskell source file
to get information about the versions of the packages that module is being
compiled against. Unfortunately, these macros are not available when not
compiling with cabal, so packages must either

1. Insist on cabal compilation. This is not very friendly to developers.
2. Make "pessimistic" assumptions, assuming that all the packages are old.
This makes it annoying to test new features while also leading to
compilation or run-time failures when packages have removed it changed
features.
3. Attempt to guess the version based on the GHC version. This works
reasonably well for base, ghc-prim, containers, etc., but not so well/at
all for others.

Would there be some way to get GHC itself to provide these macros to all
modules that request CPP?

David Feuer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150925/34e7055f/attachment.html>


More information about the ghc-devs mailing list