From fa3a688967255a5d7f7dba8430de467dc0b9e57b Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 15:33:43 +0200 Subject: Increase code locality --- src/Haddock.hs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/Haddock.hs') diff --git a/src/Haddock.hs b/src/Haddock.hs index f3535fb1..c53b4543 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -144,8 +144,11 @@ haddock args = handleTopExceptions $ do (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files -- Dump an "interface file" (.haddock file), if requested. - forM_ (optDumpInterfaceFile flags) $ \f -> do - liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks + forM_ (optDumpInterfaceFile flags) $ \path -> liftIO $ do + writeInterfaceFile path InterfaceFile { + ifInstalledIfaces = map toInstalledIface ifaces + , ifLinkEnv = homeLinks + } -- Render the interfaces. liftIO $ renderStep dflags flags qual packages ifaces @@ -284,15 +287,6 @@ readInterfaceFiles name_cache_accessor pairs = do Right f -> return $ Just (paths, f) -dumpInterfaceFile :: FilePath -> [InstalledInterface] -> LinkEnv -> IO () -dumpInterfaceFile path ifaces homeLinks = writeInterfaceFile path ifaceFile - where - ifaceFile = InterfaceFile { - ifInstalledIfaces = ifaces, - ifLinkEnv = homeLinks - } - - ------------------------------------------------------------------------------- -- * Creating a GHC session ------------------------------------------------------------------------------- -- cgit v1.2.3