diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2016-01-15 18:24:14 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2016-01-18 18:54:10 +0100 |
commit | b8abd852d3674cb485490d2b2e94906c06ee6e8f (patch) | |
tree | eddf226b9c10be8b9b982ed29c1ef61841755c6f /compiler/deSugar/DsMonad.hs | |
parent | 817dd925569d981523bbf4fb471014d46c51c7db (diff) | |
download | haskell-b8abd852d3674cb485490d2b2e94906c06ee6e8f.tar.gz |
Replace calls to `ptext . sLit` with `text`
Summary:
In the past the canonical way for constructing an SDoc string literal was the
composition `ptext . sLit`. But for some time now we have function `text` that
does the same. Plus it has some rules that optimize its runtime behaviour.
This patch takes all uses of `ptext . sLit` in the compiler and replaces them
with calls to `text`. The main benefits of this patch are clener (shorter) code
and less dependencies between module, because many modules now do not need to
import `FastString`. I don't expect any performance benefits - we mostly use
SDocs to report errors and it seems there is little to be gained here.
Test Plan: ./validate
Reviewers: bgamari, austin, goldfire, hvr, alanz
Subscribers: goldfire, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D1784
Diffstat (limited to 'compiler/deSugar/DsMonad.hs')
-rw-r--r-- | compiler/deSugar/DsMonad.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/deSugar/DsMonad.hs b/compiler/deSugar/DsMonad.hs index befad44933..92bfde0e5d 100644 --- a/compiler/deSugar/DsMonad.hs +++ b/compiler/deSugar/DsMonad.hs @@ -195,11 +195,11 @@ initDs hsc_env mod rdr_env type_env fam_inst_env thing_inside _ -> pprPgmError "Unable to use Data Parallel Haskell (DPH):" err } } - paErr = ptext (sLit "To use ParallelArrays,") <+> specBackend $$ hint1 $$ hint2 - veErr = ptext (sLit "To use -fvectorise,") <+> specBackend $$ hint1 $$ hint2 - specBackend = ptext (sLit "you must specify a DPH backend package") - hint1 = ptext (sLit "Look for packages named 'dph-lifted-*' with 'ghc-pkg'") - hint2 = ptext (sLit "You may need to install them with 'cabal install dph-examples'") + paErr = text "To use ParallelArrays," <+> specBackend $$ hint1 $$ hint2 + veErr = text "To use -fvectorise," <+> specBackend $$ hint1 $$ hint2 + specBackend = text "you must specify a DPH backend package" + hint1 = text "Look for packages named 'dph-lifted-*' with 'ghc-pkg'" + hint2 = text "You may need to install them with 'cabal install dph-examples'" initDPHBuiltins thing_inside = do { -- If '-XParallelArrays' given, we populate the builtin table for desugaring those @@ -261,7 +261,7 @@ mkDsEnvs :: DynFlags -> Module -> GlobalRdrEnv -> TypeEnv -> FamInstEnv -> (DsGblEnv, DsLclEnv) mkDsEnvs dflags mod rdr_env type_env fam_inst_env msg_var static_binds_var = let if_genv = IfGblEnv { if_rec_types = Just (mod, return type_env) } - if_lenv = mkIfLclEnv mod (ptext (sLit "GHC error in desugarer lookup in") <+> ppr mod) + if_lenv = mkIfLclEnv mod (text "GHC error in desugarer lookup in" <+> ppr mod) real_span = realSrcLocSpan (mkRealSrcLoc (moduleNameFS (moduleName mod)) 1 1) gbl_env = DsGblEnv { ds_mod = mod , ds_fam_inst_env = fam_inst_env |