Network.URI - MIN_VERSION_base problem, or finger-trouble?

Edward Kmett ekmett at
Tue Jan 1 17:18:15 CET 2013

On Tue, Jan 1, 2013 at 9:19 AM, Herbert Valerio Riedel <hvr at> wrote:

> Daniel Fischer < at> 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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list