projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make some showSDoc's use OneLineMode rather than PageMode
[ghc-hetmet.git]
/
compiler
/
utils
/
Pretty.lhs
diff --git
a/compiler/utils/Pretty.lhs
b/compiler/utils/Pretty.lhs
index
7aec715
..
3e08814
100644
(file)
--- a/
compiler/utils/Pretty.lhs
+++ b/
compiler/utils/Pretty.lhs
@@
-176,7
+176,8
@@
module Pretty (
hang, punctuate,
-- renderStyle, -- Haskell 1.3 only
hang, punctuate,
-- renderStyle, -- Haskell 1.3 only
- render, fullRender, printDoc, showDocWith
+ render, fullRender, printDoc, showDocWith,
+ bufLeftRender -- performance hack
) where
import BufWrite
) where
import BufWrite
@@
-1042,9
+1043,12
@@
hPutLitString handle a l = if l ==# _ILIT(0)
printLeftRender :: Handle -> Doc -> IO ()
printLeftRender hdl doc = do
b <- newBufHandle hdl
printLeftRender :: Handle -> Doc -> IO ()
printLeftRender hdl doc = do
b <- newBufHandle hdl
- layLeft b (reduceDoc doc)
+ bufLeftRender b doc
bFlush b
bFlush b
+bufLeftRender :: BufHandle -> Doc -> IO ()
+bufLeftRender b doc = layLeft b (reduceDoc doc)
+
-- HACK ALERT! the "return () >>" below convinces GHC to eta-expand
-- this function with the IO state lambda. Otherwise we end up with
-- closures in all the case branches.
-- HACK ALERT! the "return () >>" below convinces GHC to eta-expand
-- this function with the IO state lambda. Otherwise we end up with
-- closures in all the case branches.