From 2858bd4045afd45281fcb6b80b03d849c44464ad Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 14 May 2010 20:37:12 +0000 Subject: Make renderStep a top-level function in Main --- src/Main.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src') 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. -- cgit v1.2.3