On Tue, Jan 1, 2013 at 9:19 AM, Herbert Valerio Riedel <hvr@gnu.org> wrote:
Daniel Fischer <daniel.is.fischer@googlemail.com> writes:


[...]

> When hacking on a package without using cabal, you can
>
> a) remove the problematic macro
> b) define it in the file yourself
> c) pass -D"MIN_VERSION_base(x,y,z)=1" on the command line

what about mimicking what cabal does, e.g. create a CPP file
(e.g. 'cabal_macros.h') with the needed definitions and call ghc(i)
something along the lines of

  ghci -optP-include -optPcabal_macros.h TheModule.hs


We do a mixture of these things in lens.

We set up 

#ifndef MIN_VERSION_foo
#define MIN_VERSION_foo(x,y,z) 1
#endif

guards for each MIN_VERSION_foo macro used within a model for development in case the user hasn't configured, and we set them to sensible defaults, (aka whatever works for me), and we have a .ghci file in the repository, that works once it has been configured and which helps support doctests and ghci users with:

:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h