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/Runtime/Loader.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/Runtime/Loader.hs')
-rw-r--r-- | compiler/GHC/Runtime/Loader.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/Runtime/Loader.hs b/compiler/GHC/Runtime/Loader.hs index a1386b7937..648f80c571 100644 --- a/compiler/GHC/Runtime/Loader.hs +++ b/compiler/GHC/Runtime/Loader.hs @@ -60,8 +60,6 @@ import GHC.Utils.Error import GHC.Utils.Outputable import GHC.Utils.Exception -import GHC.Data.FastString - import Control.Monad ( unless ) import Data.Maybe ( mapMaybe ) import Unsafe.Coerce ( unsafeCoerce ) @@ -289,10 +287,10 @@ lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do doc = text "contains a name used in an invocation of lookupRdrNameInModule" wrongTyThingError :: Name -> TyThing -> SDoc -wrongTyThingError name got_thing = hsep [text "The name", ppr name, ptext (sLit "is not that of a value but rather a"), pprTyThingCategory got_thing] +wrongTyThingError name got_thing = hsep [text "The name", ppr name, text "is not that of a value but rather a", pprTyThingCategory got_thing] missingTyThingError :: Name -> SDoc -missingTyThingError name = hsep [text "The name", ppr name, ptext (sLit "is not in the type environment: are you sure it exists?")] +missingTyThingError name = hsep [text "The name", ppr name, text "is not in the type environment: are you sure it exists?"] throwCmdLineErrorS :: DynFlags -> SDoc -> IO a throwCmdLineErrorS dflags = throwCmdLineError . showSDoc dflags |