aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Types.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-07-13 13:09:16 +0000
committerDavid Waern <david.waern@gmail.com>2008-07-13 13:09:16 +0000
commitfe2a7afdfcceb85e4678eaa4ab54b51a9e890c68 (patch)
tree9e51530f62cc5e78395eccda396f5c751581872b /src/Haddock/Types.hs
parentfdd8e13d1462e63556a90bdaecf694bc7ba4c10c (diff)
Refactoring in H.Interface.Create
We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names).
Diffstat (limited to 'src/Haddock/Types.hs')
-rw-r--r--src/Haddock/Types.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index 38d56b49..e91f28cc 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -130,8 +130,7 @@ data Interface = Interface {
-- | The Haddock options for this module (prune, ignore-exports, etc)
ifaceOptions :: [DocOption],
- ifaceDeclMap :: Map Name (LHsDecl Name),
- ifaceDocMap :: Map Name (HsDoc Name),
+ ifaceDeclMap :: Map Name (LHsDecl Name, Maybe (HsDoc Name)),
ifaceRnDocMap :: Map Name (HsDoc DocName),
ifaceExportItems :: [ExportItem Name],