From 5a5c656c9817e1f0d83531cec4eeca38333519df Mon Sep 17 00:00:00 2001 From: David Waern Date: Thu, 26 Aug 2010 20:31:58 +0000 Subject: Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. --- src/Documentation/Haddock.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Documentation/Haddock.hs') diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index f277bf78..cfa1220d 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -17,7 +17,7 @@ module Documentation.Haddock ( Interface(..), InstalledInterface(..), createInterfaces, - createInterfaces', + processModules, -- * Export items & declarations ExportItem(..), @@ -63,3 +63,17 @@ import Haddock.Types import Haddock.Options import Haddock.Utils import Main + + +-- | Create 'Interface' structures from a given list of Haddock command-line +-- flags and file or module names (as accepted by 'haddock' executable). Flags +-- that control documentation generation or show help or version information +-- are ignored. +createInterfaces + :: [Flag] -- ^ A list of command-line flags + -> [String] -- ^ File or module names + -> IO [Interface] -- ^ Resulting list of interfaces +createInterfaces flags modules = do + (_, ifaces, _) <- readPackagesAndProcessModules flags modules + return ifaces + -- cgit v1.2.3