summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Utils.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-03-11 17:41:51 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-29 17:29:44 -0400
commit1d03d8bef962e6789db44e8b6f2cfd9e34f3f5ad (patch)
treed77ec6ba70bc70e87e954ecb2f56cfa39d12159e /compiler/GHC/Rename/Utils.hs
parentc2541c49f162f1d03b0ae55f47b9c76cc96df76f (diff)
downloadhaskell-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/Rename/Utils.hs')
-rw-r--r--compiler/GHC/Rename/Utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs
index e5d27fa234..e87721edaf 100644
--- a/compiler/GHC/Rename/Utils.hs
+++ b/compiler/GHC/Rename/Utils.hs
@@ -451,7 +451,7 @@ warnUnusedGRE gre@(GRE { gre_lcl = lcl, gre_imp = is })
where
span = importSpecLoc spec
pp_mod = quotes (ppr (importSpecModule spec))
- msg = text "Imported from" <+> pp_mod <+> ptext (sLit "but not used")
+ msg = text "Imported from" <+> pp_mod <+> text "but not used"
-- | Make a map from selector names to field labels and parent tycon
-- names, to be used when reporting unused record fields.
@@ -618,7 +618,7 @@ checkTupSize tup_size
| tup_size <= mAX_TUPLE_SIZE
= return ()
| otherwise
- = addErr (sep [text "A" <+> int tup_size <> ptext (sLit "-tuple is too large for GHC"),
+ = addErr (sep [text "A" <+> int tup_size <> text "-tuple is too large for GHC",
nest 2 (parens (text "max size is" <+> int mAX_TUPLE_SIZE)),
nest 2 (text "Workaround: use nested tuples or define a data type")])