diff options
Diffstat (limited to 'src/Haddock/Types.hs')
-rw-r--r-- | src/Haddock/Types.hs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index e704ae4d..e1fd5b4a 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -8,7 +8,8 @@ module Haddock.Types where -import Data.Map +import Data.Map (Map) +import qualified Data.Map as Map import Control.Monad.Writer import GHC hiding (NoLink) @@ -110,7 +111,7 @@ data GhcModule = GhcModule { -- data needed during its creation. data Interface = Interface { - -- | A value to identify the module + -- | The documented module ifaceMod :: Module, -- | The original filename for this module @@ -157,6 +158,28 @@ data Interface = Interface { } +-- | A smaller version of 'Interface' that we can get from the Haddock +-- interface files. +data InstalledInterface = InstalledInterface { + instMod :: Module, + instInfo :: HaddockModInfo Name, + instDocMap :: Map Name (HsDoc DocName), + instExports :: [Name], + instVisibleExports :: [Name] +} + + +-- | Convert an 'Interface' to an 'InstalledInterface' +toInstalledInterface :: Interface -> InstalledInterface +toInstalledInterface interface = InstalledInterface { + instMod = ifaceMod interface, + instInfo = ifaceInfo interface, + instDocMap = ifaceRnDocMap interface, + instExports = ifaceExports interface, + instVisibleExports = ifaceVisibleExports interface +} + + data DocMarkup id a = Markup { markupEmpty :: a, markupString :: String -> a, |