aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-03-27 21:19:22 +0000
committerDavid Waern <david.waern@gmail.com>2009-03-27 21:19:22 +0000
commit2265cf668d9604d407a06e11df804fc73242de00 (patch)
tree7ec47c1fac248ddcc85360012af2fcf3e490a925
parent2c2c603e58b73b646c3fe025a1d7d5570ce5739b (diff)
Remove docNameOrig and use getName everywhere instead
-rw-r--r--src/Haddock/Backends/Html.hs12
-rw-r--r--src/Haddock/DocName.hs16
2 files changed, 10 insertions, 18 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs
index b07e7845..ee6e49e9 100644
--- a/src/Haddock/Backends/Html.hs
+++ b/src/Haddock/Backends/Html.hs
@@ -787,7 +787,7 @@ ppFunSig summary links loc mbDoc docname typ =
ppTypeOrFunSig summary links loc docname typ mbDoc
(ppTypeSig summary occname typ, ppBinder False occname, dcolon)
where
- occname = nameOccName . docNameOrig $ docname
+ occname = nameOccName . getName $ docname
ppTypeOrFunSig :: Bool -> LinksInfo -> SrcSpan -> DocName -> HsType DocName ->
Maybe (HsDoc DocName) -> (Html, Html, Html) -> HtmlTable
@@ -837,7 +837,7 @@ ppTyVars tvs = map ppTyName (tyvarNames tvs)
tyvarNames :: [Located (HsTyVarBndr DocName)] -> [Name]
-tyvarNames = map (docNameOrig . hsTyVarName . unLoc)
+tyvarNames = map (getName . hsTyVarName . unLoc)
ppFor :: Bool -> LinksInfo -> SrcSpan -> Maybe Doc -> ForeignDecl DocName -> HtmlTable
@@ -913,7 +913,7 @@ ppTyFam summary associated links loc mbDoc decl
doc = ndocBox . docToHtml . fromJust $ mbDoc
- instId = collapseId (docNameOrig docname)
+ instId = collapseId (getName docname)
instancesBit = instHdr instId </>
tda [theclass "body"] <<
@@ -1025,7 +1025,7 @@ ppTypeApp n (t1:t2:rest) ppDN ppT
| operator, not . null $ rest = parens opApp <+> hsep (map ppT rest)
| operator = opApp
where
- operator = isNameSym . docNameOrig $ n
+ operator = isNameSym . getName $ n
opApp = ppT t1 <+> ppDN n <+> ppT t2
ppTypeApp n ts ppDN ppT = ppDN n <+> hsep (map ppT ts)
@@ -1151,7 +1151,7 @@ ppClassDecl summary links instances loc mbDoc _ subdocs
atTable = abovesSep s8 $ [ ppAssocType summary links doc at | at <- ats
, let doc = join $ lookup (tcdName $ unL at) subdocs ]
- instId = collapseId (docNameOrig nm)
+ instId = collapseId (getName nm)
instancesBit
| null instances = Html.emptyTable
| otherwise
@@ -1253,7 +1253,7 @@ ppDataDecl summary links instances loc mbDoc dataDecl
aboves (map ppSideBySideConstr cons)
)
- instId = collapseId (docNameOrig docname)
+ instId = collapseId (getName docname)
instancesBit
| null instances = Html.emptyTable
diff --git a/src/Haddock/DocName.hs b/src/Haddock/DocName.hs
index a3a92b5d..227d63e8 100644
--- a/src/Haddock/DocName.hs
+++ b/src/Haddock/DocName.hs
@@ -19,22 +19,14 @@ data DocName = Documented Name Module | Undocumented Name
deriving Eq
--- TODO: remove docNameOrig in favour of the NamedThing instance
-
-instance NamedThing DocName where
- getName (Documented name _) = name
- getName (Undocumented name) = name
-
-
-- | The 'OccName' belonging to this name
docNameOcc :: DocName -> OccName
-docNameOcc = nameOccName . docNameOrig
+docNameOcc = nameOccName . getName
--- | The original definition site of this name
-docNameOrig :: DocName -> Name
-docNameOrig (Documented name _) = name
-docNameOrig (Undocumented name) = name
+instance NamedThing DocName where
+ getName (Documented name _) = name
+ getName (Undocumented name) = name
instance Binary DocName where