class ??? with Haddock

Simon Marlow simonmar at
Thu Jan 8 10:02:25 EST 2004

> How do I instruct Haddock to preprocess the Haskell files.  
> From your mail I 
> thought that Haddock would do so by default but it complains 
> at the first 
> #ifdef it sees.  Unfortunately, I didn't find any Haddock 
> option similar to Hugs' -F.

I should really put this in the manual, since it gets asked so often.
Anyway, you can use GHC to preprocess your source files before feeding
them to Haddock:

   $ ghc -E -cpp -D__HADDOCK__ Foo.hs -o Foo.raw-hs
   $ haddock -h Foo.raw-hs ...

This also works to turn literate Haskell source into ... er ...
illiterate source.


More information about the Haskell mailing list