[commit: ghc] wip/prettyprinter: Use hardlineCollapse (19ee8ab)

git at git.haskell.org git at git.haskell.org
Thu Jan 18 18:08:43 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/prettyprinter
Link       : http://ghc.haskell.org/trac/ghc/changeset/19ee8ab4935cae4d9806c30f6cd581360e63042d/ghc

>---------------------------------------------------------------

commit 19ee8ab4935cae4d9806c30f6cd581360e63042d
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Sep 13 17:02:27 2017 -0400

    Use hardlineCollapse


>---------------------------------------------------------------

19ee8ab4935cae4d9806c30f6cd581360e63042d
 compiler/utils/Pretty.hs | 2 +-
 libraries/prettyprinter  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs
index ef6085d..d876972 100644
--- a/compiler/utils/Pretty.hs
+++ b/compiler/utils/Pretty.hs
@@ -216,7 +216,7 @@ infixl 6 <+>
 infixl 5 $$, $+$
 -}
 ($+$) :: Doc a -> Doc a -> Doc a
-($+$) a b = vsep [a, b]
+($+$) a b = a <> hardlineCollapse 1 <> b
 
 ($$) :: Doc a -> Doc a -> Doc a
 ($$) = ($+$)
diff --git a/libraries/prettyprinter b/libraries/prettyprinter
index 973be20..5c92fd0 160000
--- a/libraries/prettyprinter
+++ b/libraries/prettyprinter
@@ -1 +1 @@
-Subproject commit 973be208c28f0ec34c9cf7874bea9718996db776
+Subproject commit 5c92fd07537bb7070fcb560f671d4c7bb3aa7aad



More information about the ghc-commits mailing list