summaryrefslogtreecommitdiff
path: root/compiler/main/PprTyThing.hs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2016-01-15 18:24:14 +0100
committerJan Stolarek <jan.stolarek@p.lodz.pl>2016-01-18 18:54:10 +0100
commitb8abd852d3674cb485490d2b2e94906c06ee6e8f (patch)
treeeddf226b9c10be8b9b982ed29c1ef61841755c6f /compiler/main/PprTyThing.hs
parent817dd925569d981523bbf4fb471014d46c51c7db (diff)
downloadhaskell-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/main/PprTyThing.hs')
-rw-r--r--compiler/main/PprTyThing.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs
index d55b5083ec..e738d7a4fe 100644
--- a/compiler/main/PprTyThing.hs
+++ b/compiler/main/PprTyThing.hs
@@ -30,7 +30,6 @@ import TcType
import Name
import VarEnv( emptyTidyEnv )
import Outputable
-import FastString
-- -----------------------------------------------------------------------------
-- Pretty-printing entities that we get from the GHC API
@@ -88,7 +87,7 @@ pprFamInst (FamInst { fi_flavor = DataFamilyInst rep_tc })
pprFamInst (FamInst { fi_flavor = SynFamilyInst, fi_axiom = axiom
, fi_tys = lhs_tys, fi_rhs = rhs })
= showWithLoc (pprDefinedAt (getName axiom)) $
- hang (ptext (sLit "type instance") <+> pprTypeApp (coAxiomTyCon axiom) lhs_tys)
+ hang (text "type instance" <+> pprTypeApp (coAxiomTyCon axiom) lhs_tys)
2 (equals <+> ppr rhs)
----------------------------
@@ -162,4 +161,4 @@ showWithLoc loc doc
= hang doc 2 (char '\t' <> comment <+> loc)
-- The tab tries to make them line up a bit
where
- comment = ptext (sLit "--")
+ comment = text "--"