[commit: haddock] ghc-7.6: Minor code simplification (4dc9c21)

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/4dc9c211ccb6274b6663d71cf6f768d09ae76d66

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

commit 4dc9c211ccb6274b6663d71cf6f768d09ae76d66
Author: Simon Hengel <[email protected]>
Date:   Sat Oct 13 15:15:38 2012 +0200

    Minor code simplification

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

 src/Haddock.hs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Haddock.hs b/src/Haddock.hs
index 3ac2115..f3535fb 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -32,7 +32,8 @@ import Haddock.Options
 import Haddock.Utils
 import Haddock.GhcUtils hiding (pretty)
 
-import Control.Monad
+import Control.Monad hiding (forM_)
+import Data.Foldable (forM_)
 import Control.Exception
 import Data.Maybe
 import Data.IORef
@@ -143,9 +144,8 @@ haddock args = handleTopExceptions $ do
       (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files
 
       -- Dump an "interface file" (.haddock file), if requested.
-      case optDumpInterfaceFile flags of
-        Just f -> liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks
-        Nothing -> return ()
+      forM_ (optDumpInterfaceFile flags) $ \f -> do
+        liftIO $ dumpInterfaceFile f (map toInstalledIface ifaces) homeLinks
 
       -- Render the interfaces.
       liftIO $ renderStep dflags flags qual packages ifaces
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.