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-15 18:31:46 +0100 |
commit | 5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 (patch) | |
tree | e15571a0370aa7759a73ea0cd079699bcf61d073 /compiler/main/SysTools.hs | |
parent | b90cac69b2abec7df998d1d447b3fe075eb8f15c (diff) | |
download | haskell-wip/ptext-sLit-cleanup.tar.gz |
Replace calls to `ptext . sLit` with `text`wip/ptext-sLit-cleanup
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/SysTools.hs')
-rw-r--r-- | compiler/main/SysTools.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 4166b9b43a..c3436edd9e 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -1218,8 +1218,8 @@ removeWith :: DynFlags -> (FilePath -> IO ()) -> FilePath -> IO () removeWith dflags remover f = remover f `catchIO` (\e -> let msg = if isDoesNotExistError e - then ptext (sLit "Warning: deleting non-existent") <+> text f - else ptext (sLit "Warning: exception raised when deleting") + then text "Warning: deleting non-existent" <+> text f + else text "Warning: exception raised when deleting" <+> text f <> colon $$ text (show e) in debugTraceMsg dflags 2 msg @@ -1456,7 +1456,7 @@ traceCmd dflags phase_name cmd_line action } where handle_exn _verb exn = do { debugTraceMsg dflags 2 (char '\n') - ; debugTraceMsg dflags 2 (ptext (sLit "Failed:") <+> text cmd_line <+> text (show exn)) + ; debugTraceMsg dflags 2 (text "Failed:" <+> text cmd_line <+> text (show exn)) ; throwGhcExceptionIO (ProgramError (show exn))} {- |