diff options
author | David Waern <david.waern@gmail.com> | 2010-05-14 20:37:12 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2010-05-14 20:37:12 +0000 |
commit | 2858bd4045afd45281fcb6b80b03d849c44464ad (patch) | |
tree | 2a7d9e0e2cc6689a7c4cab37f729abc3899f7c16 /src/Main.hs | |
parent | 25efba7ea3721264c56ca0f8a57dd166080c7eed (diff) |
Make renderStep a top-level function in Main
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Main.hs b/src/Main.hs index af2be963..cb7e3d93 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -120,15 +120,8 @@ main = handleTopExceptions $ do (flags, fileArgs) <- parseHaddockOpts args handleEasyFlags flags - let renderStep packages interfaces = do - updateHTMLXRefs packages - let ifaceFiles = map fst packages - installedIfaces = concatMap ifInstalledIfaces ifaceFiles - render flags interfaces installedIfaces - if not (null fileArgs) then do - libDir <- getGhcLibDir flags -- Catches all GHC source errors, then prints and re-throws them. @@ -147,7 +140,7 @@ main = handleTopExceptions $ do (map fst packages) liftIO $ do -- Render the interfaces. - renderStep packages ifaces + renderStep flags packages ifaces -- Dump an "interface file" (.haddock file), if requested. case optDumpInterfaceFile flags of @@ -159,7 +152,15 @@ main = handleTopExceptions $ do packages <- readInterfaceFiles freshNameCache (ifacePairs flags) -- Render even though there are no input files (usually contents/index). - renderStep packages [] + renderStep flags packages [] + + +renderStep :: [Flag] -> [(InterfaceFile, FilePath)] -> [Interface] -> IO () +renderStep flags packages interfaces = do + updateHTMLXRefs packages + let ifaceFiles = map fst packages + installedIfaces = concatMap ifInstalledIfaces ifaceFiles + render flags interfaces installedIfaces -- | Render the interfaces with whatever backend is specified in the flags. |