<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Call the original haddockHook with the updated flags rather than the<br>

haddock command.</blockquote><div><br><span style="font-family: courier new,monospace;">-- Define CPP __HADDOCK__ macro when running haddock.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">haddockHook&#39; p l h f =</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; do putStrLn (&quot;f=\&quot;&quot; ++ show f ++ &quot;\&quot;&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; putStrLn (&quot;g=\&quot;&quot; ++ show g ++ &quot;\&quot;&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; <b>haddockHook</b> simpleUserHooks p l h g</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; where</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; -- The Haddock flag to pass a flag to GHC to define the macro.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; define__HADDOCK__ = (&quot;haddock&quot;,[&quot;--optghc=-D__HADDOCK__&quot;])</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; -- Add the flag to the the other flags.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; g = f `mappend` emptyHaddockFlags { haddockProgramArgs = [define__HADDOCK__] }</span><br style="font-family: courier new,monospace;">
<br>No change in output.<br><br>Regards,<br>Sean<br></div></div>