summaryrefslogtreecommitdiff
path: root/compiler/utils/Outputable.hs
diff options
context:
space:
mode:
authorklebinger.andreas@gmx.at <klebinger.andreas@gmx.at>2019-01-21 17:55:22 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-09 12:22:13 -0500
commit9170daa859ca5845b95acc88d10c127fb55d66fa (patch)
treeacf3aad39627f0a883e7803ba24cdbf1860659e9 /compiler/utils/Outputable.hs
parentfb031b9b046e48ffe0d2864ec76bee3bc8ff5625 (diff)
downloadhaskell-9170daa859ca5845b95acc88d10c127fb55d66fa.tar.gz
Replace a few uses of snocView with last/lastMaybe.
These never used the first part of the result from snocView. Hence replacing them with last[Maybe] is both clearer and gives better performance.
Diffstat (limited to 'compiler/utils/Outputable.hs')
-rw-r--r--compiler/utils/Outputable.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index bb3b9d3177..b3d77aa843 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -609,8 +609,8 @@ quotes d =
else SDoc $ \sty ->
let pp_d = runSDoc d sty
str = show pp_d
- in case (str, snocView str) of
- (_, Just (_, '\'')) -> pp_d
+ in case (str, lastMaybe str) of
+ (_, Just '\'') -> pp_d
('\'' : _, _) -> pp_d
_other -> Pretty.quotes pp_d