aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-02-18 00:00:24 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-18 00:05:56 +0100
commitfdd07f36c26b7f8452c3e15aca312b32821f1ea5 (patch)
tree99b57b5e185a27abf90bed345044d5eb9a1be122 /haddock-api/src/Haddock/Backends
parent43532d74c2c4374260b8176b88026de571d5a344 (diff)
Xhtml.Decl: Show kind signatures for type family variables
Addresses GHC #11588.
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 5fca8f7d..59b444a0 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -263,7 +263,7 @@ ppTyFamHeader summary associated d@(FamilyDecl { fdInfo = info
-> keyword "type family"
) <+>
- ppFamDeclBinderWithVars summary d <+>
+ ppFamDeclBinderWithVars summary unicode qual d <+>
ppResultSig result unicode qual <+>
(case injectivity of
@@ -347,9 +347,9 @@ ppAssocType summ links doc (L loc decl) fixities splice unicode qual =
--------------------------------------------------------------------------------
-- | Print a type family and its variables
-ppFamDeclBinderWithVars :: Bool -> FamilyDecl DocName -> Html
-ppFamDeclBinderWithVars summ (FamilyDecl { fdLName = lname, fdTyVars = tvs }) =
- ppAppDocNameNames summ (unLoc lname) (tyvarNames tvs)
+ppFamDeclBinderWithVars :: Bool -> Unicode -> Qualification -> FamilyDecl DocName -> Html
+ppFamDeclBinderWithVars summ unicode qual (FamilyDecl { fdLName = lname, fdTyVars = tvs }) =
+ ppAppDocNameTyVarBndrs summ unicode qual (unLoc lname) (map unLoc $ hsq_explicit tvs)
-- | Print a newtype / data binder and its variables
ppDataBinderWithVars :: Bool -> TyClDecl DocName -> Html
@@ -360,6 +360,13 @@ ppDataBinderWithVars summ decl =
-- * Type applications
--------------------------------------------------------------------------------
+ppAppDocNameTyVarBndrs :: Bool -> Unicode -> Qualification -> DocName -> [HsTyVarBndr DocName] -> Html
+ppAppDocNameTyVarBndrs summ unicode qual n vs =
+ ppTypeApp n [] vs ppDN (ppHsTyVarBndr unicode qual)
+ where
+ ppDN notation = ppBinderFixity notation summ . nameOccName . getName
+ ppBinderFixity Infix = ppBinderInfix
+ ppBinderFixity _ = ppBinder
-- | Print an application of a 'DocName' and two lists of 'HsTypes' (kinds, types)
ppAppNameTypes :: DocName -> [HsType DocName] -> [HsType DocName]