aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends
diff options
context:
space:
mode:
authorƁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-21 14:36:37 +0200
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-08-21 18:22:31 +0100
commit59d809746c08e3e3e506da5eeaaaed9d04407743 (patch)
tree6536731fa09ac56b73efb13b902ab54edc739bec /haddock-api/src/Haddock/Backends
parentb4a82b390e3b6d7d5f1c10c42c4e36d5d7cf667b (diff)
Make specialized methods be nicely formatted again.
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index b3e1db81..4862945a 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -223,10 +223,14 @@ ppTyName :: Name -> Html
ppTyName = ppName Prefix
-ppSimpleSig :: Unicode -> Qualification -> [DocName] -> HsType DocName -> Html
-ppSimpleSig unicode qual names typ =
- ppTypeSig True occNames ppTyp unicode
+ppSimpleSig :: LinksInfo -> Splice -> Unicode -> Qualification
+ -> [DocName] -> HsType DocName
+ -> Html
+ppSimpleSig links splice unicode qual names typ =
+ topDeclElem' names $ ppTypeSig True occNames ppTyp unicode
where
+ -- TODO: Use *helpful* source span.
+ topDeclElem' = topDeclElem links (UnhelpfulSpan undefined) splice
ppTyp = ppType unicode qual typ
occNames = map getOccName names
@@ -550,7 +554,7 @@ ppInstanceSigs links splice unicode qual (InstSpec {..}) (InstHead {..}) = do
TypeSig lnames (L sspan typ) _ <- ispecSigs
let names = map unLoc lnames
let typ' = rename' . sugar $ specializeTyVarBndrs ispecTyVars ihdTypes typ
- return $ ppSimpleSig unicode qual names typ'
+ return $ ppSimpleSig links splice unicode qual names typ'
where
fv = foldr Set.union Set.empty . map freeVariables $ ihdTypes
rename' = rename fv