diff options
| author | simonmar <unknown> | 2002-06-03 14:12:38 +0000 | 
|---|---|---|
| committer | simonmar <unknown> | 2002-06-03 14:12:38 +0000 | 
| commit | 145b462641d65312469136a87266dfb1d41e04ea (patch) | |
| tree | ae2982816956cd12062d93a74c6301085a91b911 /src | |
| parent | 1c0a3bed1a29729abb1f389441e71fc2bfe2e1f7 (diff) | |
[haddock @ 2002-06-03 14:12:38 by simonmar]
Render class names as proper binders
Diffstat (limited to 'src')
| -rw-r--r-- | src/HaddockHtml.hs | 24 | 
1 files changed, 13 insertions, 11 deletions
| diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index f6f4aa3e..791152bb 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -611,11 +611,14 @@ ppHsBangType (HsUnBangedTy ty) = ppHsAType ty  -- -----------------------------------------------------------------------------  -- Class declarations -ppClassHdr [] n tvs fds =  -  keyword "class" <+> ppHsAsst (UnQual n, map HsTyVar tvs) <+> ppFds fds -ppClassHdr ctxt n tvs fds =  -  keyword "class" <+> ppHsContext ctxt <+> darrow <+>  -	ppHsAsst (UnQual n, map HsTyVar tvs) <+> ppFds fds +ppClassHdr summ [] n tvs fds =  +  keyword "class" +	<+> ppHsBinder summ n <+> hsep (map ppHsName tvs) +	<+> ppFds fds +ppClassHdr summ ctxt n tvs fds =  +  keyword "class" <+> ppHsContext ctxt <+> darrow +	<+> ppHsBinder summ n <+> hsep (map ppHsName tvs) +	<+> ppFds fds  ppFds fds =    if null fds then noHtml else  @@ -639,8 +642,7 @@ ppShortClassDecl summary inst_maps     where  	Just c = declMainBinder decl -	hdr | not summary = linkTarget c +++ ppClassHdr ctxt nm tvs fds -	    | otherwise   = ppClassHdr ctxt nm tvs fds +	hdr = ppClassHdr summary ctxt nm tvs fds  ppHsClassDecl summary inst_maps@(cls_inst_map, _) orig_c   	decl@(HsClassDecl loc ctxt nm tvs fds decls doc) @@ -656,10 +658,10 @@ ppHsClassDecl summary inst_maps@(cls_inst_map, _) orig_c  	Just c = declMainBinder decl  	header -	   | null decls = declBox (linkTarget c +++ ppClassHdr ctxt nm tvs fds) -	   | otherwise  = declBox (linkTarget c +++  -				    ppClassHdr ctxt nm tvs fds <+>  -				    keyword "where") +	   | null decls = declBox hdr +	   | otherwise  = declBox (hdr <+> keyword "where") + +	hdr = ppClassHdr summary ctxt nm tvs fds  	classdoc  	   | Just d <- doc = ndocBox (docToHtml d) | 
