[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haddock version

Simon Marlow simonmarhaskell at gmail.com
Wed Jan 9 07:03:24 EST 2008

Felipe Lessa wrote:
> On Jan 8, 2008 10:28 AM, David Waern <david.waern at gmail.com> wrote:
>>   * Haddock now understands all syntax understood by GHC 6.8.2
> Does Haddock still define __HADDOCK__? There's a lot of code that uses
> this flag just to hide something Haddock didn't know.

Haddock itself never defined __HADDOCK__, because it didn't do the CPP 
preprocessing itself.  Cabal adds __HADDOCK__ itself when preprocessing 
files for passing to Haddock.  When used with Haddock version 2, Cabal no 
longer defines __HADDOCK__ when preprocessing.

Haddock 2 can do the preprocessing itself, because it is processing the 
Haskell files using the GHC API.  In this case, if you want __HADDOCK__ 
defined, you have to add it explicitly with --optghc -D__HADDOCK__.

The easiest way to use Haddock 2 is via Cabal, which will automatically add 
the appropriate options for your package, including the right -B option 
which Haddock now needs in order that the GHC API can find its package 


More information about the Haskell-Cafe mailing list