[commit: ghc] wip/prettyprinter: Try something (2e06574)

git at git.haskell.org git at git.haskell.org
Wed Aug 16 22:47:39 UTC 2017


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

On branch  : wip/prettyprinter
Link       : http://ghc.haskell.org/trac/ghc/changeset/2e0657415aaa2cfead23cb44f8bc671df6269fc6/ghc

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

commit 2e0657415aaa2cfead23cb44f8bc671df6269fc6
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Jun 24 13:01:37 2017 -0400

    Try something


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

2e0657415aaa2cfead23cb44f8bc671df6269fc6
 compiler/utils/Pretty.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs
index 0f6ca4b..a7969e6 100644
--- a/compiler/utils/Pretty.hs
+++ b/compiler/utils/Pretty.hs
@@ -1008,10 +1008,10 @@ renderStyle s d = TL.unpack $ renderLazy (layoutPretty (styleToLayoutOptions s)
 
 printDoc :: Mode -> Int -> Handle -> Doc a -> IO ()
 -- printDoc adds a newline to the end
-printDoc mode cols hdl doc = printDoc_ mode cols hdl (doc <> hardline)
+printDoc mode cols hdl doc = printDoc_ mode cols hdl (doc)
 
 printDoc_ :: Mode -> Int -> Handle -> Doc a -> IO ()
-printDoc_ mode pprCols hdl doc = TL.hPutStr hdl (renderLazy $ layoutPretty (mkLayoutOptions mode pprCols) doc) where
+printDoc_ mode pprCols hdl doc = TL.hPutStrLn hdl (renderLazy $ layoutPretty (mkLayoutOptions mode pprCols) doc) where
   mkLayoutOptions :: Mode -> Int -> LayoutOptions
   -- Note that this should technically be 1.5 as per the old implementation.
   -- I have no idea why that is.



More information about the ghc-commits mailing list