<p dir="ltr">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</p>
<p dir="ltr">1. Insist on cabal compilation. This is not very friendly to developers.<br>
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.<br>
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.</p>
<p dir="ltr">Would there be some way to get GHC itself to provide these macros to all modules that request CPP?</p>
<p dir="ltr">David Feuer</p>