From: simonmar Date: Wed, 15 Aug 2001 16:27:15 +0000 (+0000) Subject: [project @ 2001-08-15 16:27:15 by simonmar] X-Git-Tag: Approximately_9120_patches~1220 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=98b5d9f61854afb1ed4c8cf819154c1b89eb88bf;p=ghc-hetmet.git [project @ 2001-08-15 16:27:15 by simonmar] Slight prettification of class declarations when printed out in non-interface mode. --- diff --git a/ghc/compiler/hsSyn/HsDecls.lhs b/ghc/compiler/hsSyn/HsDecls.lhs index 6d1befb..5be8245 100644 --- a/ghc/compiler/hsSyn/HsDecls.lhs +++ b/ghc/compiler/hsSyn/HsDecls.lhs @@ -44,6 +44,8 @@ import Outputable import Util ( eqListBy ) import SrcLoc ( SrcLoc ) import FastString + +import Maybe ( isNothing, fromJust ) \end{code} @@ -485,8 +487,11 @@ instance (NamedThing name, Outputable name, Outputable pat) where top_matter = ptext SLIT("class") <+> pp_decl_head context clas tyvars <+> pprFundeps fds ppr_sig sig = ppr sig <> semi + pp_methods = getPprStyle $ \ sty -> - if ifaceStyle sty then empty else ppr methods + if ifaceStyle sty || isNothing methods + then empty + else ppr (fromJust methods) pp_decl_head :: Outputable name => HsContext name -> name -> [HsTyVarBndr name] -> SDoc pp_decl_head context thing tyvars = hsep [pprHsContext context, ppr thing, interppSP tyvars]