<p dir="ltr">I&#39;m calling haddock myself. Cabal might have some special magic for CPP, when I searched for &quot;haddock CPP&quot; I got some old bugs about adding cabal support. So presumably it&#39;s possible. </p>
<div class="gmail_quote">On Jul 12, 2013 1:15 PM, &quot;Felipe Almeida Lessa&quot; &lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you using `cabal haddock` or calling haddock manually?<br>
<br>
Cheers,<br>
<br>
On Fri, Jul 12, 2013 at 3:25 PM, Evan Laforge &lt;<a href="mailto:qdunkan@gmail.com">qdunkan@gmail.com</a>&gt; wrote:<br>
&gt; So haddock ignores {-# LANGUAGE CPP #-}, which makes it crash on any<br>
&gt; file that uses it.  But if you pass --optghc=-cpp, it runs CPP on<br>
&gt; everything, which makes it crash on any file that uses string gaps, or<br>
&gt; happens to contain a /*.  /* is rare and easily fixed, but not string<br>
&gt; gaps.<br>
&gt;<br>
&gt; It looks like a workaround would be to manually inspect the files for<br>
&gt; LANGUAGE CPP and run two haddock passes, but then I would have to get<br>
&gt; the two passes to cooperate creating a single TOC and index.<br>
&gt;<br>
&gt; Isn&#39;t there some way to run haddock on files that use CPP?<br>
&gt;<br>
&gt; In the broader scheme, it seems perverse to be using CPP in the first<br>
&gt; place.  I use it to configure imports and exports, e.g. to swap out a<br>
&gt; driver backend on different OSes, and to export more symbols when<br>
&gt; testing.  Would it make sense to have a haskell version of CPP that<br>
&gt; provides only these features (e.g. just #ifdef, #else, #endif, and<br>
&gt; #define) and leaves out the problematic C comments and backslash<br>
&gt; expectations?<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br>
<br>
<br>
--<br>
Felipe.<br>
</blockquote></div>