aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/Types.hs26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index ccac6014..03818fa4 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -6,13 +6,15 @@
-- Ported to use the GHC API by David Waern 2006
--
+
module Haddock.Types where
+
import GHC hiding (NoLink)
import Outputable
-
import Data.Map
+
data DocOption
= OptHide -- ^ This module should not appear in the docs
| OptPrune
@@ -21,11 +23,12 @@ data DocOption
-- exported by this module.
deriving (Eq, Show)
+
data ExportItem name
= ExportDecl {
- -- | The original name
+ -- | The original name
expItemName :: Name,
-- | A declaration
@@ -34,13 +37,13 @@ data ExportItem name
-- | Maybe a doc comment
expItemMbDoc :: Maybe (HsDoc name),
- -- | Instances relevant to this declaration
+ -- | Instances relevant to this declaration
expItemInstances :: [InstHead name]
} -- ^ An exported declaration
| ExportNoDecl {
- -- | The original name
+ -- | The original name
expItemName :: Name,
-- | Where to link to
@@ -50,8 +53,8 @@ data ExportItem name
expItemSubs :: [name]
} -- ^ An exported entity for which we have no
- -- documentation (perhaps because it resides in
- -- another package)
+ -- documentation (perhaps because it resides in
+ -- another package)
| ExportGroup {
@@ -59,10 +62,10 @@ data ExportItem name
expItemSectionLevel :: Int,
-- | Section id (for hyperlinks)
- expItemSectionId :: String,
+ expItemSectionId :: String,
- -- | Section heading text
- expItemSectionText :: HsDoc name
+ -- | Section heading text
+ expItemSectionText :: HsDoc name
} -- ^ A section heading
@@ -70,17 +73,21 @@ data ExportItem name
| ExportModule Module -- ^ A cross-reference to another module
+
type InstHead name = ([HsPred name], name, [HsType name])
type ModuleMap = Map Module HaddockModule
type DocMap = Map Name (HsDoc DocName)
type DocEnv = Map Name Name
+
data DocName = Link Name | NoLink Name
+
instance Outputable DocName where
ppr (Link n) = ppr n
ppr (NoLink n) = ppr n
+
data HaddockModule = HM {
-- | A value to identify the module
@@ -129,6 +136,7 @@ data HaddockModule = HM {
hmod_instances :: [Instance]
}
+
data DocMarkup id a = Markup {
markupEmpty :: a,
markupString :: String -> a,