[commit: haddock] ghc-7.6: Increase code locality (fa3a688)

Simon Hengel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/fa3a688967255a5d7f7dba8430de467dc0b9e57b

>---------------------------------------------------------------

commit fa3a688967255a5d7f7dba8430de467dc0b9e57b
Author: Simon Hengel <[email protected]>
Date:   Sat Oct 13 15:33:43 2012 +0200

    Increase code locality

>---------------------------------------------------------------

 src/Haddock.hs |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/Haddock.hs b/src/Haddock.hs
index f3535fb..c53b454 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
 -------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.