From b8abd852d3674cb485490d2b2e94906c06ee6e8f Mon Sep 17 00:00:00 2001 From: Jan Stolarek Date: Fri, 15 Jan 2016 18:24:14 +0100 Subject: 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 --- compiler/prelude/ForeignCall.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler/prelude/ForeignCall.hs') diff --git a/compiler/prelude/ForeignCall.hs b/compiler/prelude/ForeignCall.hs index a08f64b621..f23436bda6 100644 --- a/compiler/prelude/ForeignCall.hs +++ b/compiler/prelude/ForeignCall.hs @@ -67,9 +67,9 @@ data Safety {-! derive: Binary !-} instance Outputable Safety where - ppr PlaySafe = ptext (sLit "safe") - ppr PlayInterruptible = ptext (sLit "interruptible") - ppr PlayRisky = ptext (sLit "unsafe") + ppr PlaySafe = text "safe" + ppr PlayInterruptible = text "interruptible" + ppr PlayRisky = text "unsafe" playSafe :: Safety -> Bool playSafe PlaySafe = True @@ -154,11 +154,11 @@ data CCallConv = CCallConv | CApiConv | StdCallConv | PrimCallConv | JavaScriptC {-! derive: Binary !-} instance Outputable CCallConv where - ppr StdCallConv = ptext (sLit "stdcall") - ppr CCallConv = ptext (sLit "ccall") - ppr CApiConv = ptext (sLit "capi") - ppr PrimCallConv = ptext (sLit "prim") - ppr JavaScriptCallConv = ptext (sLit "javascript") + ppr StdCallConv = text "stdcall" + ppr CCallConv = text "ccall" + ppr CApiConv = text "capi" + ppr PrimCallConv = text "prim" + ppr JavaScriptCallConv = text "javascript" defaultCCallConv :: CCallConv defaultCCallConv = CCallConv -- cgit v1.2.1