aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/Names.hs
diff options
context:
space:
mode:
authorTobias Brandt <tob.brandt@gmail.com>2010-08-27 07:01:21 +0000
committerTobias Brandt <tob.brandt@gmail.com>2010-08-27 07:01:21 +0000
commit2b87648737ad5b07e30d9bb03f7c4e3953566c24 (patch)
tree36454035a50838b558720351f0cd4886e19dfeb2 /src/Haddock/Backends/Xhtml/Names.hs
parent957f4ad40b1eb9931d2b2de80f4bc8e28e22b4fa (diff)
adding the option to fully qualify identifiers
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Names.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/Names.hs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Haddock/Backends/Xhtml/Names.hs b/src/Haddock/Backends/Xhtml/Names.hs
index 068fc0f7..6df32fc4 100644
--- a/src/Haddock/Backends/Xhtml/Names.hs
+++ b/src/Haddock/Backends/Xhtml/Names.hs
@@ -38,16 +38,21 @@ ppRdrName :: RdrName -> Html
ppRdrName = ppOccName . rdrNameOcc
-ppLDocName :: Located DocName -> Html
-ppLDocName (L _ d) = ppDocName d
+ppLDocName :: Qualification -> Located DocName -> Html
+ppLDocName quali (L _ d) = ppDocName quali d
-ppDocName :: DocName -> Html
-ppDocName (Documented name mdl) =
- linkIdOcc mdl (Just occName) << ppOccName occName
+ppDocName :: Qualification -> DocName -> Html
+ppDocName quali (Documented name mdl) =
+ linkIdOcc mdl (Just occName) << theName
where occName = nameOccName name
-ppDocName (Undocumented name) = toHtml (getOccString name)
+ theName = case quali of
+ NoQuali -> ppName name
+ FullQuali -> ppQualName mdl name
+ppDocName _ (Undocumented name) = ppName name
+ppQualName :: Module -> Name -> Html
+ppQualName mdl name = toHtml $ moduleString mdl ++ '.' : getOccString name
ppName :: Name -> Html
ppName name = toHtml (getOccString name)