From ec9caa150f5126c392e5cce1969cf6a81ee4c86b Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 20 Nov 2010 19:06:00 +0000 Subject: Haddock documentation updates --- src/Documentation/Haddock.hs | 3 +-- src/Haddock/Types.hs | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index 496c1f00..96198494 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -26,7 +26,7 @@ module Documentation.Haddock ( DocForDecl, FnArgsDoc, - -- * Hyperlinking + -- * Cross-referencing LinkEnv, DocName(..), @@ -42,7 +42,6 @@ module Documentation.Haddock ( markup, -- * Interface files - -- | (.haddock files) InterfaceFile(..), readInterfaceFile, nameCacheFromGhc, diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 3cfc7875..c00870f9 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -106,8 +106,8 @@ data Interface = Interface { ifaceHaddockCoverage :: (Int,Int) } --- | A smaller version of 'Interface' that can be created from Haddock's --- interface files ('InterfaceFile'). +-- | A subset of the fields of 'Interface' that we store in the interface +-- files. data InstalledInterface = InstalledInterface { -- | The module represented by this interface. @@ -221,18 +221,24 @@ unrenameDocForDecl (mbDoc, fnArgsDoc) = ----------------------------------------------------------------------------- --- * Hyperlinking +-- * Cross-referencing ----------------------------------------------------------------------------- --- | An environment used to create hyper-linked syntax. +-- | Type of environment used to cross-reference identifiers in the syntax. type LinkEnv = Map Name Module --- | An extension of 'Name' that may contain the preferred place to link to in --- the documentation. -data DocName = Documented Name Module | Undocumented Name deriving Eq --- TODO: simplify to data DocName = DocName Name (Maybe Module) +-- | Extends 'Name' with cross-reference information. +data DocName + = Documented Name Module + -- ^ This thing is part of the (existing or resulting) + -- documentation. The 'Module' is the preferred place + -- in the documentation to refer to. + | Undocumented Name + -- ^ This thing is not part of the (existing or resulting) + -- documentation, as far as Haddock knows. + deriving Eq instance NamedThing DocName where -- cgit v1.2.3