<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Let&#39;s suppose that I do actually want to define __HADDOCK__ for my library.<br>
Can I do this with a user-defined hook using the Cabal library?<br>
</blockquote>
<br></div>
You might want to define it conditionally, depending on version.<br>
</blockquote><div><br>I certainly might!<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Cabal supports package-version macros, and haddock installs both<br>

a package (the paths are wrong in the package description, but you<br>
can find the version number there) and an executable for itself, but the package version macros are not available in Setup.hs.<br>
</blockquote><div><br>That&#39;s good to know. And I just found the documentation:<br><a href="http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html#cpp">http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html#cpp</a><br>
<br>This sounds like it only works with package dependencies. Does it also work with Haddock as a processing tool?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Still, you might find something useful in the discussion for this ticket:<br>
<br>
 &nbsp; Cabal should support Cabal-version-dependent Setup.hs<br>
 &nbsp; <a href="http://hackage.haskell.org/trac/hackage/ticket/326" target="_blank">http://hackage.haskell.org/trac/hackage/ticket/326</a><font color="#888888"><br></font></blockquote></div><br>Thanks for the tip.<br><br>Regards,<br>
Sean<br>