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/specialise/Rules.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/specialise/Rules.hs')
-rw-r--r-- | compiler/specialise/Rules.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index 531b13166c..fbae186915 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -421,10 +421,10 @@ findBest target (rule1,ans1) ((rule2,ans2):prs) | otherwise = doubleQuotes (ftext (ru_name rule)) in pprTrace "Rules.findBest: rule overlap (Rule 1 wins)" (vcat [if opt_PprStyle_Debug then - ptext (sLit "Expression to match:") <+> ppr fn <+> sep (map ppr args) + text "Expression to match:" <+> ppr fn <+> sep (map ppr args) else empty, - ptext (sLit "Rule 1:") <+> pp_rule rule1, - ptext (sLit "Rule 2:") <+> pp_rule rule2]) $ + text "Rule 1:" <+> pp_rule rule1, + text "Rule 2:" <+> pp_rule rule2]) $ findBest target (rule1,ans1) prs | otherwise = findBest target (rule1,ans1) prs where @@ -575,11 +575,11 @@ matchN (in_scope, id_unf) rule_name tmpl_vars tmpl_es target_es = env unbound var = pprPanic "Template variable unbound in rewrite rule" $ - vcat [ ptext (sLit "Variable:") <+> ppr var - , ptext (sLit "Rule") <+> pprRuleName rule_name - , ptext (sLit "Rule bndrs:") <+> ppr tmpl_vars - , ptext (sLit "LHS args:") <+> ppr tmpl_es - , ptext (sLit "Actual args:") <+> ppr target_es ] + vcat [ text "Variable:" <+> ppr var + , text "Rule" <+> pprRuleName rule_name + , text "Rule bndrs:" <+> ppr tmpl_vars + , text "LHS args:" <+> ppr tmpl_es + , text "Actual args:" <+> ppr target_es ] {- Note [Unbound template type variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1185,9 +1185,9 @@ ruleAppCheck_help env fn args rules rule_herald rule <> colon <+> rule_info dflags rule rule_herald (BuiltinRule { ru_name = name }) - = ptext (sLit "Builtin rule") <+> doubleQuotes (ftext name) + = text "Builtin rule" <+> doubleQuotes (ftext name) rule_herald (Rule { ru_name = name }) - = ptext (sLit "Rule") <+> doubleQuotes (ftext name) + = text "Rule" <+> doubleQuotes (ftext name) rule_info dflags rule | Just _ <- matchRule dflags (emptyInScopeSet, rc_id_unf env) |