diff options
author | simonmar <unknown> | 2005-02-02 16:23:04 +0000 |
---|---|---|
committer | simonmar <unknown> | 2005-02-02 16:23:04 +0000 |
commit | d8450a233a8e9e0fabcd34e9daf53c82db4dd3bd (patch) | |
tree | 4d05856cf7d2181061b6deb5931a34756dec57c4 /src/HaddockUtil.hs | |
parent | a8c82f239a7fa8940abb35c32b82b4ebec9f6761 (diff) |
[haddock @ 2005-02-02 16:23:00 by simonmar]
Revamp the linking strategy in Haddock.
Now name resolution is done in two phases:
- first resolve everything to original names, like a Haskell compiler
would.
- then, figure out the "home" location for every entity, and point
all the links to there. The home location is the lowest non-hidden
module in the import hierarchy that documents the entity. If there
are multiple candidates, one is chosen at random.
Also:
- Haddock should not generate any HTML with dangling links any more.
Unlinked references are just rendered as plain text.
- Error reporting is better: if we can't find a link destination for
an entity reference, we now emit a warning.
Diffstat (limited to 'src/HaddockUtil.hs')
-rw-r--r-- | src/HaddockUtil.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index 434d935e..eacde1bb 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -10,7 +10,7 @@ module HaddockUtil ( -- * Misc utilities nameOfQName, collectNames, declBinders, declMainBinder, declSubBinders, splitTyConApp, restrictTo, declDoc, parseModuleHeader, freeTyCons, unbang, - addFieldDoc, addFieldDocs, addConDoc, addConDocs,toDescription, + addFieldDoc, addFieldDocs, addConDoc, addConDocs,toDescription, unQual, -- * Filename utilities basename, dirname, splitFilename3, @@ -51,6 +51,10 @@ nameOfQName :: HsQName -> HsName nameOfQName (Qual _ n) = n nameOfQName (UnQual n) = n +unQual :: HsQName -> HsQName +unQual (Qual _ n) = UnQual n +unQual n = n + collectNames :: [HsDecl] -> [HsName] collectNames ds = concat (map declBinders ds) |