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/rename/RnSplice.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/rename/RnSplice.hs')
-rw-r--r-- | compiler/rename/RnSplice.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rename/RnSplice.hs b/compiler/rename/RnSplice.hs index 9ddf132311..9279be1570 100644 --- a/compiler/rename/RnSplice.hs +++ b/compiler/rename/RnSplice.hs @@ -534,12 +534,12 @@ rnSplicePat. spliceCtxt :: HsSplice RdrName -> SDoc spliceCtxt splice - = hang (ptext (sLit "In the") <+> what) 2 (ppr splice) + = hang (text "In the" <+> what) 2 (ppr splice) where what = case splice of - HsUntypedSplice {} -> ptext (sLit "untyped splice:") - HsTypedSplice {} -> ptext (sLit "typed splice:") - HsQuasiQuote {} -> ptext (sLit "quasi-quotation:") + HsUntypedSplice {} -> text "untyped splice:" + HsTypedSplice {} -> text "typed splice:" + HsQuasiQuote {} -> text "quasi-quotation:" -- | The splice data to be logged data SpliceInfo @@ -589,16 +589,16 @@ traceSplice (SpliceInfo { spliceDescription = sd, spliceSource = mb_src , gen ] illegalTypedSplice :: SDoc -illegalTypedSplice = ptext (sLit "Typed splices may not appear in untyped brackets") +illegalTypedSplice = text "Typed splices may not appear in untyped brackets" illegalUntypedSplice :: SDoc -illegalUntypedSplice = ptext (sLit "Untyped splices may not appear in typed brackets") +illegalUntypedSplice = text "Untyped splices may not appear in typed brackets" -- spliceResultDoc :: OutputableBndr id => LHsExpr id -> SDoc -- spliceResultDoc expr --- = vcat [ hang (ptext (sLit "In the splice:")) +-- = vcat [ hang (text "In the splice:") -- 2 (char '$' <> pprParendExpr expr) --- , ptext (sLit "To see what the splice expanded to, use -ddump-splices") ] +-- , text "To see what the splice expanded to, use -ddump-splices" ] #endif checkThLocalName :: Name -> RnM () |