diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-02-03 17:57:29 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-20 21:18:48 -0500 |
commit | 6880d6aa1e6e96579bbff89712efd813489cc828 (patch) | |
tree | f2156d5a5c168bf28ee569a62a74b51adf74dac9 /compiler/GHC/Hs/Binds.hs | |
parent | 74ad75e87317196c600dfabc61aee1b87d95c214 (diff) | |
download | haskell-6880d6aa1e6e96579bbff89712efd813489cc828.tar.gz |
Disentangle DynFlags and SDoc
Remove several uses of `sdocWithDynFlags`. The remaining ones are mostly
CodeGen related (e.g. depend on target platform constants) and will be
fixed separately.
Metric Decrease:
T12425
T9961
WWRec
T1969
T14683
Diffstat (limited to 'compiler/GHC/Hs/Binds.hs')
-rw-r--r-- | compiler/GHC/Hs/Binds.hs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs index 2014d92c25..6796216c87 100644 --- a/compiler/GHC/Hs/Binds.hs +++ b/compiler/GHC/Hs/Binds.hs @@ -19,6 +19,7 @@ Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@. {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE LambdaCase #-} module GHC.Hs.Binds where @@ -42,7 +43,6 @@ import Var import Bag import FastString import BooleanFormula (LBooleanFormula) -import DynFlags import Data.Data hiding ( Fixity ) import Data.List hiding ( foldr ) @@ -739,20 +739,19 @@ ppr_monobind (PatSynBind _ psb) = ppr psb ppr_monobind (AbsBinds { abs_tvs = tyvars, abs_ev_vars = dictvars , abs_exports = exports, abs_binds = val_binds , abs_ev_binds = ev_binds }) - = sdocWithDynFlags $ \ dflags -> - if gopt Opt_PrintTypecheckerElaboration dflags then - -- Show extra information (bug number: #10662) - hang (text "AbsBinds" <+> brackets (interpp'SP tyvars) - <+> brackets (interpp'SP dictvars)) - 2 $ braces $ vcat - [ text "Exports:" <+> - brackets (sep (punctuate comma (map ppr exports))) - , text "Exported types:" <+> - vcat [pprBndr LetBind (abe_poly ex) | ex <- exports] - , text "Binds:" <+> pprLHsBinds val_binds - , pprIfTc @idR (text "Evidence:" <+> ppr ev_binds) ] - else - pprLHsBinds val_binds + = sdocOption sdocPrintTypecheckerElaboration $ \case + False -> pprLHsBinds val_binds + True -> -- Show extra information (bug number: #10662) + hang (text "AbsBinds" <+> brackets (interpp'SP tyvars) + <+> brackets (interpp'SP dictvars)) + 2 $ braces $ vcat + [ text "Exports:" <+> + brackets (sep (punctuate comma (map ppr exports))) + , text "Exported types:" <+> + vcat [pprBndr LetBind (abe_poly ex) | ex <- exports] + , text "Binds:" <+> pprLHsBinds val_binds + , pprIfTc @idR (text "Evidence:" <+> ppr ev_binds) + ] ppr_monobind (XHsBindsLR x) = ppr x instance OutputableBndrId p => Outputable (ABExport (GhcPass p)) where |