[commit: ghc] ghc-7.8: Honor Op_PrintExplicitForalls setting in pprIfaceForAllPart (0a2e5aa)
git at git.haskell.org
git at git.haskell.org
Sat Mar 22 19:38:26 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-7.8
Link : http://ghc.haskell.org/trac/ghc/changeset/0a2e5aa2ac80969c6ccc95ad8e6d031b8aaa1771/ghc
>---------------------------------------------------------------
commit 0a2e5aa2ac80969c6ccc95ad8e6d031b8aaa1771
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date: Fri Mar 14 19:50:15 2014 +0800
Honor Op_PrintExplicitForalls setting in pprIfaceForAllPart
(cherry picked from commit f3eeb93529798b80721a9801aa1bf2ea7a1de049)
>---------------------------------------------------------------
0a2e5aa2ac80969c6ccc95ad8e6d031b8aaa1771
compiler/iface/IfaceType.lhs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/compiler/iface/IfaceType.lhs b/compiler/iface/IfaceType.lhs
index 8c1791a..e4a789f 100644
--- a/compiler/iface/IfaceType.lhs
+++ b/compiler/iface/IfaceType.lhs
@@ -31,6 +31,8 @@ module IfaceType (
) where
import Coercion
+import TcType
+import DynFlags
import TypeRep hiding( maybeParen )
import Unique( hasKey )
import TyCon
@@ -248,7 +250,7 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _)
where
(tvs, theta, tau) = splitIfaceSigmaTy ty
- -------------------
+-------------------
-- needs to handle type contexts and coercion contexts, hence the
-- generality
pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc
@@ -256,7 +258,10 @@ pprIfaceForAllPart tvs ctxt doc
= sep [ppr_tvs, pprIfaceContextArr ctxt, doc]
where
ppr_tvs | null tvs = empty
- | otherwise = ptext (sLit "forall") <+> pprIfaceTvBndrs tvs <> dot
+ | otherwise = sdocWithDynFlags $ \ dflags ->
+ if gopt Opt_PrintExplicitForalls dflags
+ then ptext (sLit "forall") <+> pprIfaceTvBndrs tvs <> dot
+ else empty
-------------------
ppr_tc_app :: (Int -> a -> SDoc) -> Int -> IfaceTyCon -> [a] -> SDoc
More information about the ghc-commits
mailing list