[commit: ghc] master: Pretty: Args of NilAbove/TextBeside/Nest/Union are always RDocs (#10735) (6f6d082)

git at git.haskell.org git at git.haskell.org
Wed Aug 5 08:11:09 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6f6d082124b24bd8437f95d99a8fd8844a0f6cd8/ghc

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

commit 6f6d082124b24bd8437f95d99a8fd8844a0f6cd8
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Mon Aug 3 19:34:36 2015 +0200

    Pretty: Args of NilAbove/TextBeside/Nest/Union are always RDocs (#10735)
    
    Just following libraries/pretty.


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

6f6d082124b24bd8437f95d99a8fd8844a0f6cd8
 compiler/utils/Pretty.hs | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs
index 87881ce..12a8a53 100644
--- a/compiler/utils/Pretty.hs
+++ b/compiler/utils/Pretty.hs
@@ -583,20 +583,17 @@ mkUnion :: Doc -> Doc -> Doc
 mkUnion Empty _ = Empty
 mkUnion p q     = p `union_` q
 
--- Arg of a NilAbove is always an RDoc
-nilAbove_ :: Doc -> Doc
+nilAbove_ :: RDoc -> RDoc
 nilAbove_ = NilAbove
 
 -- Arg of a TextBeside is always an RDoc
-textBeside_ :: TextDetails -> FastInt -> Doc -> Doc
+textBeside_ :: TextDetails -> FastInt -> RDoc -> RDoc
 textBeside_ = TextBeside
 
--- Arg of Nest is always an RDoc
-nest_ :: FastInt -> Doc -> Doc
+nest_ :: FastInt -> RDoc -> RDoc
 nest_ = Nest
 
--- Args of union are always RDocs
-union_ :: Doc -> Doc -> Doc
+union_ :: RDoc -> RDoc -> RDoc
 union_ = Union
 
 
@@ -791,7 +788,7 @@ fsep = fill True
 -- layout1 $*$ layout2 | hasMoreThanOneLine layout1 = layout1 $$ layout2
 --                     | otherwise                  = layout1 $+$ layout2
 
-fill :: Bool -> [Doc] -> Doc
+fill :: Bool -> [Doc] -> RDoc
 fill _ []     = empty
 fill g (p:ps) = fill1 g (reduceDoc p) (_ILIT(0)) ps
 



More information about the ghc-commits mailing list