Am Donnerstag, 8. Januar 2004 11:02 schrieb Simon Marlow:
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.
So I have to write the preprocessed source to disk instead of piping it to Haddock when haddocking multiple files. Hmm, sounds not so good :-( but is, of course, not such a big problem.
Cheers, Simon
Wolfgang