summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-04-25 18:38:34 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-25 18:39:51 -0400
commitda792e47981f65b2dba4fc76ce51dc3fb9c4c02d (patch)
treeb962d875d058c6db652dfc681debcb0a9dcd7b80 /compiler/iface
parent71c3cea60c74054b6ba9ed918a58814aa91e01c2 (diff)
downloadhaskell-da792e47981f65b2dba4fc76ce51dc3fb9c4c02d.tar.gz
Only pretty-print binders in closed type families with -fprint-explicit-foralls
Previously, we were unconditionally pretty-printing all type variable binders when pretty-printing closed type families (e.g., in the output of `:info` in GHCi). This threw me for a loop, so let's guard this behind the `-fprint-explicit-foralls` flag. Test Plan: make test TEST=T13420 Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13420 Differential Revision: https://phabricator.haskell.org/D3497
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/IfaceSyn.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs
index 5db8c99cb4..047ed257fe 100644
--- a/compiler/iface/IfaceSyn.hs
+++ b/compiler/iface/IfaceSyn.hs
@@ -67,6 +67,7 @@ import TyCon ( Role (..), Injectivity(..) )
import Util( filterOut, filterByList )
import DataCon (SrcStrictness(..), SrcUnpackedness(..))
import Lexeme (isLexSym)
+import DynFlags
import Control.Monad
import System.IO.Unsafe
@@ -554,7 +555,10 @@ pprAxBranch pp_tc (IfaceAxBranch { ifaxbTyVars = tvs
$+$
nest 2 maybe_incomps
where
- ppr_binders
+ ppr_binders = sdocWithDynFlags $ \dflags ->
+ ppWhen (gopt Opt_PrintExplicitForalls dflags) ppr_binders'
+
+ ppr_binders'
| null tvs && null cvs = empty
| null cvs
= brackets (pprWithCommas (pprIfaceTvBndr True) tvs)