On Tue, Jan 1, 2013 at 9:19 AM, Herbert Valerio Riedel <span dir="ltr">&lt;<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Daniel Fischer &lt;<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>&gt; writes:<br>
<br>
<br>
[...]<br>
<div class="im"><br>
&gt; When hacking on a package without using cabal, you can<br>
&gt;<br>
&gt; a) remove the problematic macro<br>
&gt; b) define it in the file yourself<br>
&gt; c) pass -D&quot;MIN_VERSION_base(x,y,z)=1&quot; on the command line<br>
<br>
</div>what about mimicking what cabal does, e.g. create a CPP file<br>
(e.g. &#39;cabal_macros.h&#39;) with the needed definitions and call ghc(i)<br>
something along the lines of<br>
<br>
  ghci -optP-include -optPcabal_macros.h TheModule.hs<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>We do a mixture of these things in lens.</div><div><br></div><div>We set up </div><div><br></div><div><font face="courier new, monospace">#ifndef MIN_VERSION_foo</font></div>
<div><font face="courier new, monospace">#define MIN_VERSION_foo(x,y,z) 1</font></div><div><font face="courier new, monospace">#endif</font></div><div><br></div><div>guards for each <font face="courier new, monospace">MIN_VERSION_foo</font> macro used within a model for development in case the user hasn&#39;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:</div>
<div><br></div><div class="frames" style="margin:0px;padding:0px;border:0px;width:10000px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.333333015441895px;line-height:24px;background-color:rgb(255,255,255);min-height:1244px">
<div class="frame" style="margin:0px 100px 0px 0px;padding:0px;border:0px;float:left;width:920px"><div id="files" class="bubble" style="margin:0px;padding:3px;border:0px;background-color:rgb(238,238,238);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-repeat:initial initial">
<div class="file" style="margin:0px;padding:0px;border:1px solid rgb(204,204,204);background-color:rgb(236,236,236);background-repeat:initial initial"><div class="data type-text" style="margin:0px;padding:0px;border:0px;overflow:auto;background-color:rgb(255,255,255);background-repeat:initial initial">
<table cellpadding="0" cellspacing="0" class="lines" style="margin:0px;padding:0px;border:0px;border-collapse:collapse;border-spacing:0px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;font-style:inherit;font-variant:inherit;line-height:1.4">
<tbody style="margin:0px;padding:0px;border:0px"><tr style="margin:0px;padding:0px;border:0px"><td width="100%" style="margin:0px;padding:0px;border:0px"><div class="highlight" style="margin:0px;padding:0px;border:none"><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:12px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace">
<div class="line" id="LC1" style="margin:0px;padding:0px 0px 0px 10px;border:0px">:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h</div></pre></div></td></tr></tbody></table></div></div>
</div></div></div></div>