diff options
author | Simon Hengel <sol@typeful.net> | 2012-10-13 15:33:43 +0200 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2012-10-13 15:33:43 +0200 |
commit | fa3a688967255a5d7f7dba8430de467dc0b9e57b (patch) | |
tree | ca355985d90a936bd3554b1a152d5c0be27c9484 /src | |
parent | 4dc9c211ccb6274b6663d71cf6f768d09ae76d66 (diff) |
Increase code locality
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock.hs | 16 |
1 files changed, 5 insertions, 11 deletions
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 ------------------------------------------------------------------------------- |