From 4dc9c211ccb6274b6663d71cf6f768d09ae76d66 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 13 Oct 2012 15:15:38 +0200 Subject: Minor code simplification --- src/Haddock.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Haddock.hs b/src/Haddock.hs index 3ac2115d..f3535fb1 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 -- cgit v1.2.3