diff options
author | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-03-12 20:38:26 +0800 |
---|---|---|
committer | Dr. ERDI Gergo <gergo@erdi.hu> | 2014-03-13 21:20:51 +0800 |
commit | 23c0f1ec2cf06c0178c2ae7414fe57ea648689e7 (patch) | |
tree | d71a571dbc7cb5ee45e137cf2160f482b80b022c /compiler/iface | |
parent | 4d1b7b4a9b986e87755784478b4ea4883a5e203e (diff) | |
download | haskell-23c0f1ec2cf06c0178c2ae7414fe57ea648689e7.tar.gz |
pprIfaceContextArr: print a context including the "=>" arrow
Diffstat (limited to 'compiler/iface')
-rw-r--r-- | compiler/iface/IfaceSyn.lhs | 2 | ||||
-rw-r--r-- | compiler/iface/IfaceType.lhs | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index b582305434..3691fcabc0 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -1152,7 +1152,7 @@ instance Outputable IfaceAT where pprIfaceDeclHead :: IfaceContext -> OccName -> [IfaceTvBndr] -> SDoc pprIfaceDeclHead context thing tyvars - = hsep [pprIfaceContext context, parenSymOcc thing (ppr thing), + = hsep [pprIfaceContextArr context, parenSymOcc thing (ppr thing), pprIfaceTvBndrs tyvars] pp_condecls :: OccName -> IfaceConDecls -> SDoc diff --git a/compiler/iface/IfaceType.lhs b/compiler/iface/IfaceType.lhs index 822e3da75a..8c1791a16a 100644 --- a/compiler/iface/IfaceType.lhs +++ b/compiler/iface/IfaceType.lhs @@ -22,7 +22,7 @@ module IfaceType ( toIfaceCoercion, -- Printing - pprIfaceType, pprParendIfaceType, pprIfaceContext, + pprIfaceType, pprParendIfaceType, pprIfaceContext, pprIfaceContextArr, pprIfaceIdBndr, pprIfaceTvBndr, pprIfaceTvBndrs, pprIfaceBndrs, tOP_PREC, tYCON_PREC, noParens, maybeParen, pprIfaceForAllPart, @@ -253,7 +253,7 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _) -- generality pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc pprIfaceForAllPart tvs ctxt doc - = sep [ppr_tvs, pprIfaceContext ctxt, doc] + = sep [ppr_tvs, pprIfaceContextArr ctxt, doc] where ppr_tvs | null tvs = empty | otherwise = ptext (sLit "forall") <+> pprIfaceTvBndrs tvs <> dot @@ -386,14 +386,14 @@ instance Binary IfaceTyLit where _ -> panic ("get IfaceTyLit " ++ show tag) ------------------- -pprIfaceContext :: Outputable a => [a] -> SDoc +pprIfaceContextArr :: Outputable a => [a] -> SDoc -- Prints "(C a, D b) =>", including the arrow -pprIfaceContext [] = empty -pprIfaceContext theta = ppr_preds theta <+> darrow +pprIfaceContextArr [] = empty +pprIfaceContextArr theta = pprIfaceContext theta <+> darrow -ppr_preds :: Outputable a => [a] -> SDoc -ppr_preds [pred] = ppr pred -- No parens -ppr_preds preds = parens (sep (punctuate comma (map ppr preds))) +pprIfaceContext :: Outputable a => [a] -> SDoc +pprIfaceContext [pred] = ppr pred -- No parens +pprIfaceContext preds = parens (sep (punctuate comma (map ppr preds))) instance Binary IfaceType where put_ bh (IfaceForAllTy aa ab) = do |