aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Decl.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 6e733373..d92bdd3a 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -566,8 +566,8 @@ ppInstances links origin instances splice unicode qual
where
instName = getOccString origin
instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName)
- instDecl no (inst, mdoc, loc) =
- ((ppInstHead links splice unicode qual mdoc origin False no inst), loc)
+ instDecl no (inst, mdoc, loc, mdl) =
+ ((ppInstHead links splice unicode qual mdoc origin False no inst mdl), loc)
ppOrphanInstances :: LinksInfo
@@ -581,8 +581,8 @@ ppOrphanInstances links instances splice unicode qual
instOrigin inst = OriginClass (ihdClsName inst)
instDecl :: Int -> DocInstance DocNameI -> (SubDecl,Located DocName)
- instDecl no (inst, mdoc, loc) =
- ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst), loc)
+ instDecl no (inst, mdoc, loc, mdl) =
+ ((ppInstHead links splice unicode qual mdoc (instOrigin inst) True no inst mdl), loc)
ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification
@@ -591,13 +591,14 @@ ppInstHead :: LinksInfo -> Splice -> Unicode -> Qualification
-> Bool -- ^ Is instance orphan
-> Int -- ^ Normal
-> InstHead DocNameI
+ -> Maybe Module
-> SubDecl
-ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) =
+ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) mdl =
case ihdInstType of
ClassInst { .. } ->
( subInstHead iid $ ppContextNoLocs clsiCtx unicode qual HideEmptyContexts <+> typ
, mdoc
- , [subInstDetails iid ats sigs]
+ , [subInstDetails iid ats sigs mname]
)
where
sigs = ppInstanceSigs links splice unicode qual clsiSigs
@@ -605,7 +606,7 @@ ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) =
TypeInst rhs ->
( subInstHead iid ptype
, mdoc
- , [subFamInstDetails iid prhs]
+ , [subFamInstDetails iid prhs mname]
)
where
ptype = keyword "type" <+> typ
@@ -614,11 +615,12 @@ ppInstHead links splice unicode qual mdoc origin orphan no ihd@(InstHead {..}) =
DataInst dd ->
( subInstHead iid pdata
, mdoc
- , [subFamInstDetails iid pdecl])
+ , [subFamInstDetails iid pdecl mname])
where
pdata = keyword "data" <+> typ
pdecl = pdata <+> ppShortDataDecl False True dd [] unicode qual
where
+ mname = maybe noHtml (\m -> toHtml "Defined in" <+> ppModule m) mdl
iid = instanceId origin no orphan ihd
typ = ppAppNameTypes ihdClsName ihdTypes unicode qual