- $ defaultMainWithHooksArgs hooks ("haddock" : "--builddir" : distdir : args)
- where
- hooks = userHooks {
- haddockHook = modHook (haddockHook userHooks)
- }
- modHook f pd lbi us flags
- | packageName pd == PackageName "ghc-prim"
- = let pd' = case library pd of
- Just lib ->
- let ghcPrim = fromJust (simpleParse "GHC.Prim")
- ems = filter (ghcPrim /=)
- (exposedModules lib)
- lib' = lib { exposedModules = ems }
- in pd { library = Just lib' }
- Nothing ->
- error "Expected a library, but none found"
- pc = withPrograms lbi
- pc' = userSpecifyArgs "haddock"
- ["dist-install/build/autogen/GHC/Prim.hs"] pc
- lbi' = lbi { withPrograms = pc' }
- in f pd' lbi' us flags
- | otherwise
- = f pd lbi us flags