From ce3ff856c9412d5392fb7a5c37445f60f84cb2d2 Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Fri, 21 Jun 2013 14:08:25 +0100 Subject: Updates to reflect changes in HsDecls to support closed type families. --- src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/Haddock/Backends/Xhtml') diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index db39ccca..2ecc6464 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -145,23 +145,25 @@ ppTyName name ppTyFamHeader :: Bool -> Bool -> FamilyDecl DocName -> Bool -> Qualification -> Html -ppTyFamHeader summary associated d@(FamilyDecl { fdFlavour = flav +ppTyFamHeader summary associated d@(FamilyDecl { fdInfo = info , fdKindSig = mkind }) unicode qual = - (case flav of - TypeFamily + (case info of + OpenTypeFamily | associated -> keyword "type" | otherwise -> keyword "type family" DataFamily | associated -> keyword "data" | otherwise -> keyword "data family" + ClosedTypeFamily _ + -> keyword "type family" ) <+> ppFamDeclBinderWithVars summary d <+> - case mkind of + (case mkind of Just kind -> dcolon unicode <+> ppLKind unicode qual kind Nothing -> noHtml - + ) ppTyFam :: Bool -> Bool -> LinksInfo -> SrcSpan -> Documentation DocName -> FamilyDecl DocName -> Bool -> Qualification -> Html @@ -175,7 +177,13 @@ ppTyFam summary associated links loc doc decl unicode qual header_ = topDeclElem links loc [docname] (ppTyFamHeader summary associated decl unicode qual) - instancesBit = ppInstances instances docname unicode qual + instancesBit + | FamilyDecl { fdInfo = ClosedTypeFamily _eqns } <- decl + , not summary + = noHtml -- TODO: print eqns + + | otherwise + = ppInstances instances docname unicode qual -- TODO: get the instances instances = [] -- cgit v1.2.3