summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-03-02 18:37:23 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-02 19:58:01 -0500
commit615ded12f47d3685606bcfabb4f1980e748be1d9 (patch)
tree80727cab9a2f376388ddc421eaef4a839b5cbe81 /libraries
parent6421c6f2bb56bcdf2415e8556180821eedd77d2d (diff)
downloadhaskell-615ded12f47d3685606bcfabb4f1980e748be1d9.tar.gz
Show: Add ShowS for ", "
This is produced often enough in derived Show instances that it is likely worthwhile defining it once.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Show.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/GHC/Show.hs b/libraries/base/GHC/Show.hs
index c52824b165..6965335e64 100644
--- a/libraries/base/GHC/Show.hs
+++ b/libraries/base/GHC/Show.hs
@@ -39,7 +39,7 @@ module GHC.Show
-- Show support code
shows, showChar, showString, showMultiLineString,
- showParen, showList__, showSpace,
+ showParen, showList__, showCommaSpace, showSpace,
showLitChar, showLitString, protectEsc,
intToDigit, showSignedInt,
appPrec, appPrec1,
@@ -344,6 +344,8 @@ showParen b p = if b then showChar '(' . p . showChar ')' else p
showSpace :: ShowS
showSpace = {-showChar ' '-} \ xs -> ' ' : xs
+showCommaSpace :: ShowS
+showCommaSpace = showString ", "
-- Code specific for characters
-- | Convert a character to a string using only printable characters,