X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FHsDecls.lhs;h=5be8245edc17dee763d11b260065bec2590d8f94;hb=98b5d9f61854afb1ed4c8cf819154c1b89eb88bf;hp=6d1befb58ddb2fbc7861a48ffb429bebeface2e1;hpb=01d6d2d0a2758f9e2a9a61521e710f8154334e01;p=ghc-hetmet.git 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]