[commit: ghc] wip/prettyprinter: Try something (dae4a38)
git at git.haskell.org
git at git.haskell.org
Wed Sep 13 21:08:56 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/prettyprinter
Link : http://ghc.haskell.org/trac/ghc/changeset/dae4a38d0496c521fc4f5ee205cac07afca4f963/ghc
>---------------------------------------------------------------
commit dae4a38d0496c521fc4f5ee205cac07afca4f963
Author: Ben Gamari <ben at smart-cactus.org>
Date: Sat Jun 24 13:01:37 2017 -0400
Try something
>---------------------------------------------------------------
dae4a38d0496c521fc4f5ee205cac07afca4f963
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