X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FhsSyn%2FHsDecls.lhs;h=d8e1a348b88ac3767e0dc8abaab22516b859ed4d;hp=8ff39857c610ab4d4af4e3ef09c914af3818651a;hb=3afa01b9ff2006864e3ce4b4d960f0289a266ea2;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index 8ff3985..d8e1a34 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -462,7 +462,7 @@ instance OutputableBndr name | otherwise -- Laid out = sep [hsep [top_matter, ptext SLIT("where {")], - nest 4 (sep [sep (map ppr_sig sigs), ppr methods, char '}'])] + nest 4 (sep [sep (map ppr_sig sigs), pprLHsBinds methods, char '}'])] where top_matter = ptext SLIT("class") <+> pp_decl_head (unLoc context) lclas tyvars <+> pprFundeps (map unLoc fds) ppr_sig sig = ppr sig <> semi @@ -569,13 +569,13 @@ pprConDecl (ConDecl con expl tvs cxt details ResTyH98) ppr_details con (PrefixCon tys) = hsep (pprHsVar con : map ppr tys) ppr_details con (RecCon fields) = ppr con <+> ppr_fields fields -pprConDecl (ConDecl con expl tvs cxt details (ResTyGADT res_ty)) - = sep [pprHsForAll expl tvs cxt, ppr con <+> ppr_details details] +pprConDecl (ConDecl con expl tvs cxt (PrefixCon arg_tys) (ResTyGADT res_ty)) + = ppr con <+> dcolon <+> + sep [pprHsForAll expl tvs cxt, ppr (foldr mk_fun_ty res_ty arg_tys)] where - ppr_details (PrefixCon arg_tys) = dcolon <+> ppr (foldr mk_fun_ty res_ty arg_tys) - ppr_details (RecCon fields) = ppr fields <+> dcolon <+> ppr res_ty - mk_fun_ty a b = noLoc (HsFunTy a b) +pprConDecl (ConDecl con expl tvs cxt (RecCon fields) (ResTyGADT res_ty)) + = sep [pprHsForAll expl tvs cxt, ppr con <+> ppr fields <+> dcolon <+> ppr res_ty] ppr_fields fields = braces (sep (punctuate comma (map ppr_field fields))) ppr_field (n, ty) = ppr n <+> dcolon <+> ppr ty