Skip to content
Snippets Groups Projects
Commit a819a19d authored by Gergő Érdi's avatar Gergő Érdi
Browse files

Honor Op_PrintExplicitForalls setting in pprIfaceForAllPart

parent 1ea02299
No related merge requests found
...@@ -31,6 +31,8 @@ module IfaceType ( ...@@ -31,6 +31,8 @@ module IfaceType (
) where ) where
import Coercion import Coercion
import TcType
import DynFlags
import TypeRep hiding( maybeParen ) import TypeRep hiding( maybeParen )
import Unique( hasKey ) import Unique( hasKey )
import TyCon import TyCon
...@@ -248,7 +250,7 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _) ...@@ -248,7 +250,7 @@ ppr_ty ctxt_prec ty@(IfaceForAllTy _ _)
where where
(tvs, theta, tau) = splitIfaceSigmaTy ty (tvs, theta, tau) = splitIfaceSigmaTy ty
------------------- -------------------
-- needs to handle type contexts and coercion contexts, hence the -- needs to handle type contexts and coercion contexts, hence the
-- generality -- generality
pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc pprIfaceForAllPart :: Outputable a => [IfaceTvBndr] -> [a] -> SDoc -> SDoc
...@@ -256,7 +258,10 @@ pprIfaceForAllPart tvs ctxt doc ...@@ -256,7 +258,10 @@ pprIfaceForAllPart tvs ctxt doc
= sep [ppr_tvs, pprIfaceContextArr ctxt, doc] = sep [ppr_tvs, pprIfaceContextArr ctxt, doc]
where where
ppr_tvs | null tvs = empty 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 ppr_tc_app :: (Int -> a -> SDoc) -> Int -> IfaceTyCon -> [a] -> SDoc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment