summaryrefslogtreecommitdiff
path: root/ghc
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 /ghc
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 'ghc')
-rw-r--r--ghc/GHCi/UI.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 4f126b92b3..c2dbb64a5a 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -1508,7 +1508,7 @@ withSandboxOnly cmd this = do
dflags <- getDynFlags
if not (gopt Opt_GhciSandbox dflags)
then printForUser (text cmd <+>
- ptext (sLit "is not supported with -fno-ghci-sandbox"))
+ text "is not supported with -fno-ghci-sandbox")
else this
-----------------------------------------------------------------------------
@@ -3344,12 +3344,12 @@ showContext = do
printForUser $ vcat (map pp_resume (reverse resumes))
where
pp_resume res =
- ptext (sLit "--> ") <> text (GHC.resumeStmt res)
+ text "--> " <> text (GHC.resumeStmt res)
$$ nest 2 (pprStopped res)
pprStopped :: GHC.Resume -> SDoc
pprStopped res =
- ptext (sLit "Stopped in")
+ text "Stopped in"
<+> ((case mb_mod_name of
Nothing -> empty
Just mod_name -> text (moduleNameString mod_name) <> char '.')
@@ -3957,7 +3957,7 @@ backCmd arg
where
back num = withSandboxOnly ":back" $ do
(names, _, pan, _) <- GHC.back num
- printForUser $ ptext (sLit "Logged breakpoint at") <+> ppr pan
+ printForUser $ text "Logged breakpoint at" <+> ppr pan
printTypeOfNames names
-- run the command set with ":set stop <cmd>"
st <- getGHCiState
@@ -3972,8 +3972,8 @@ forwardCmd arg
forward num = withSandboxOnly ":forward" $ do
(names, ix, pan, _) <- GHC.forward num
printForUser $ (if (ix == 0)
- then ptext (sLit "Stopped at")
- else ptext (sLit "Logged breakpoint at")) <+> ppr pan
+ then text "Stopped at"
+ else text "Logged breakpoint at") <+> ppr pan
printTypeOfNames names
-- run the command set with ":set stop <cmd>"
st <- getGHCiState