aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
diff options
context:
space:
mode:
authorƁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-07-21 13:43:48 +0200
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-08-21 18:22:31 +0100
commitb4a82b390e3b6d7d5f1c10c42c4e36d5d7cf667b (patch)
tree8cbdab9ebf68cab50c28c5bceb3751a3b36bcd4a /haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
parenta314ebd0af69cc1f6c76bfd8242d88d47277fcda (diff)
Make specialized signatures refer to original signature declaration.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Decl.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 176180ad..b3e1db81 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -223,6 +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
+ where
+ ppTyp = ppType unicode qual typ
+ occNames = map getOccName names
+
+
--------------------------------------------------------------------------------
-- * Type families
--------------------------------------------------------------------------------
@@ -542,8 +550,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 $ ppFunSig False links sspan noDocForDecl names typ' []
- splice unicode qual
+ return $ ppSimpleSig unicode qual names typ'
where
fv = foldr Set.union Set.empty . map freeVariables $ ihdTypes
rename' = rename fv