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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to