diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-03-11 17:41:51 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-29 17:29:44 -0400 |
commit | 1d03d8bef962e6789db44e8b6f2cfd9e34f3f5ad (patch) | |
tree | d77ec6ba70bc70e87e954ecb2f56cfa39d12159e /compiler/GHC/Hs/ImpExp.hs | |
parent | c2541c49f162f1d03b0ae55f47b9c76cc96df76f (diff) | |
download | haskell-1d03d8bef962e6789db44e8b6f2cfd9e34f3f5ad.tar.gz |
Replace (ptext .. sLit) with `text`
1. `text` is as efficient as `ptext . sLit` thanks to the rewrite rules
2. `text` is visually nicer than `ptext . sLit`
3. `ptext . sLit` encourages using one `ptext` for several `sLit` as in:
ptext $ case xy of
... -> sLit ...
... -> sLit ...
which may allocate SDoc's TextBeside constructors at runtime instead
of sharing them into CAFs.
Diffstat (limited to 'compiler/GHC/Hs/ImpExp.hs')
-rw-r--r-- | compiler/GHC/Hs/ImpExp.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/GHC/Hs/ImpExp.hs b/compiler/GHC/Hs/ImpExp.hs index 55b5af7bc9..05e176d9f7 100644 --- a/compiler/GHC/Hs/ImpExp.hs +++ b/compiler/GHC/Hs/ImpExp.hs @@ -25,7 +25,6 @@ import GHC.Types.FieldLabel ( FieldLabel ) import GHC.Utils.Outputable import GHC.Utils.Panic -import GHC.Data.FastString import GHC.Types.SrcLoc import Language.Haskell.Syntax.Extension import GHC.Hs.Extension @@ -164,7 +163,7 @@ instance (OutputableBndrId p 4 (pp_spec spec) where pp_implicit False = empty - pp_implicit True = ptext (sLit ("(implicit)")) + pp_implicit True = text "(implicit)" pp_pkg Nothing = empty pp_pkg (Just (StringLiteral st p _)) |