summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-06-24 12:40:35 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-20 22:45:15 -0400
commit34edba0e312cb736b26370536f65fb49d9b51b5e (patch)
treef217a0700411bfc5458ba30e66e472195d5f41da /compiler/utils
parentfa32633f2abc9b69145783eb473f7c785c39c1b9 (diff)
downloadhaskell-34edba0e312cb736b26370536f65fb49d9b51b5e.tar.gz
Fix errant newlines
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Pretty.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs
index 15b8c64416..0f6ca4b5d3 100644
--- a/compiler/utils/Pretty.hs
+++ b/compiler/utils/Pretty.hs
@@ -123,6 +123,7 @@ import GHC.Ptr ( Ptr(..) )
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.IO as TL
import Data.Text.Prettyprint.Doc
-- PI = PrettyprinterInternal
@@ -1010,7 +1011,7 @@ printDoc :: Mode -> Int -> Handle -> Doc a -> IO ()
printDoc mode cols hdl doc = printDoc_ mode cols hdl (doc <> hardline)
printDoc_ :: Mode -> Int -> Handle -> Doc a -> IO ()
-printDoc_ mode pprCols hdl doc = renderIO hdl (layoutPretty (mkLayoutOptions mode pprCols) doc) where
+printDoc_ mode pprCols hdl doc = TL.hPutStr 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.