[Haskell-cafe] Problem with haddock 2.3.0 (again)

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Dec 11 18:41:35 EST 2008


On Fri, 2008-12-12 at 00:22 +0100, Sean Leather wrote:

> Let's suppose that I do actually want to define __HADDOCK__ for my
> library. Can I do this with a user-defined hook using the Cabal
> library?
> 
> main :: IO ()
> main = defaultMainWithHooks hooks where
>   hooks = simpleUserHooks { haddockHook = haddockHook' }
> 
> -- Define CPP __HADDOCK__ macro when running haddock.
> haddockHook' p l h f =
>   do putStrLn ("f=\"" ++ show f ++ "\"")
>      putStrLn ("f'=\"" ++ show f' ++ "\"")
>      haddock p l (hookedPreProcessors h) f'

Call the original haddockHook with the updated flags rather than the
haddock command.

Duncan



More information about the Haskell-Cafe mailing list