diff options
author | Richard Eisenberg <rae@richarde.dev> | 2020-01-29 10:15:01 +0000 |
---|---|---|
committer | Richard Eisenberg <rae@richarde.dev> | 2020-01-29 10:15:01 +0000 |
commit | 288b674de9b09e782e7a407d65add2d6ebf1acab (patch) | |
tree | f6dcca950ff0aa73ca028a15c0eb84f3bb2f7c35 /compiler/GHC/Hs/ImpExp.hs | |
parent | 7e3feb00443f7f46717ed33f18728cc4a59debf0 (diff) | |
download | haskell-wip/smaller-constraints.tar.gz |
Try dropping OutputableBndrId in favor of IsPasswip/smaller-constraints
Diffstat (limited to 'compiler/GHC/Hs/ImpExp.hs')
-rw-r--r-- | compiler/GHC/Hs/ImpExp.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/GHC/Hs/ImpExp.hs b/compiler/GHC/Hs/ImpExp.hs index 32cc3b21a9..87851c89f5 100644 --- a/compiler/GHC/Hs/ImpExp.hs +++ b/compiler/GHC/Hs/ImpExp.hs @@ -13,6 +13,8 @@ GHC.Hs.ImpExp: Abstract syntax: imports, exports, interfaces {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] -- in module GHC.Hs.PlaceHolder +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE ScopedTypeVariables #-} module GHC.Hs.ImpExp where @@ -324,14 +326,17 @@ replaceLWrappedName :: LIEWrappedName name1 -> name2 -> LIEWrappedName name2 replaceLWrappedName (L l n) n' = L l (replaceWrappedName n n') instance OutputableBndrId p => Outputable (IE (GhcPass p)) where - ppr (IEVar _ var) = ppr (unLoc var) - ppr (IEThingAbs _ thing) = ppr (unLoc thing) - ppr (IEThingAll _ thing) = hcat [ppr (unLoc thing), text "(..)"] + ppr (IEVar _ var) = withOutputableBndr @p $ ppr (unLoc var) + ppr (IEThingAbs _ thing) = withOutputableBndr @p $ ppr (unLoc thing) + ppr (IEThingAll _ thing) = withOutputableBndr @p $ hcat [ppr (unLoc thing), text "(..)"] ppr (IEThingWith _ thing wc withs flds) - = ppr (unLoc thing) <> parens (fsep (punctuate comma + = withOutputableBndr @p $ + ppr (unLoc thing) <> parens (fsep (punctuate comma (ppWiths ++ map (ppr . flLabel . unLoc) flds))) where + ppWiths :: OutputableBndr (IdP (GhcPass p)) => [SDoc] + -- this type signature is necessary because of -XMonoLocalBinds ppWiths = case wc of NoIEWildcard -> |