Re: MIN_VERSION macros

2015-10-21 Thread Edward Z. Yang
Hi all, I've implemented this: https://phabricator.haskell.org/D1349 Cheers, Edward Excerpts from Reid Barton's message of 2015-09-25 15:15:09 -0700: > On Fri, Sep 25, 2015 at 4:09 PM, Edward Z. Yang wrote: > > > Excerpts from Reid Barton's message of 2015-09-25 12:36:48

MIN_VERSION macros

2015-09-25 Thread David Feuer
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

Re: MIN_VERSION macros

2015-09-25 Thread Eric Seidel
think it's just a matter of adding the logic. I would love to see the MIN_VERSION macros moved to GHC. Eric On Fri, Sep 25, 2015, at 09:06, David Feuer wrote: > Cabal defines MIN_VERSION_* macros that allow CPP in a Haskell source > file > to get information about the versions of the

Re: MIN_VERSION macros

2015-09-25 Thread Herbert Valerio Riedel
On 2015-09-25 at 20:48:52 +0200, Richard Eisenberg wrote: > I've run into this issue, too. Post a feature request! I can't imagine > it's too hard to implement. For the current external CPP we'll probably have to create a temporary file with the definitions (just like cabal does) to -include (as

Re: MIN_VERSION macros

2015-09-25 Thread Reid Barton
On Fri, Sep 25, 2015 at 12:18 PM, Eric Seidel wrote: > I've been meaning to ask about this as well. It also forces tools like > ghc-mod and hdevtools to be cabal-aware, which is an unnecessary source > of complexity IMO. > This would certainly be nice, but... GHC certainly has

Re: MIN_VERSION macros

2015-09-25 Thread Richard Eisenberg
aware, which is an unnecessary source > of complexity IMO. > > GHC certainly has enough information to generate these macros, as it > knows which packages (and versions) it's compiling against. I think it's > just a matter of adding the logic. > > I would love to see th

Re: MIN_VERSION macros

2015-09-25 Thread Edward Z. Yang
Excerpts from Reid Barton's message of 2015-09-25 12:36:48 -0700: > It knows at some point, but it doesn't necessarily know before parsing the > module, at which point it is too late. I can have two versions of a package > A, and two other packages B and C that depend on different versions of A, >

Re: MIN_VERSION macros

2015-09-25 Thread Reid Barton
On Fri, Sep 25, 2015 at 4:09 PM, Edward Z. Yang wrote: > Excerpts from Reid Barton's message of 2015-09-25 12:36:48 -0700: > > GHC could provide MIN_VERSION_* macros for packages that have had their > > versions specified with -package or similar flags (which is how Cabal > >