[commit: ghc] master: Pretty: kill code that has been dead since 1997 (#10735) (2d1eae2)

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


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2d1eae26f83bdff3bc5f5eb98101e4fd718afd62/ghc

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

commit 2d1eae26f83bdff3bc5f5eb98101e4fd718afd62
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Mon Aug 3 19:23:21 2015 +0200

    Pretty: kill code that has been dead since 1997 (#10735)


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

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

diff --git a/compiler/utils/Pretty.hs b/compiler/utils/Pretty.hs
index 62a1a1c..87881ce 100644
--- a/compiler/utils/Pretty.hs
+++ b/compiler/utils/Pretty.hs
@@ -296,9 +296,6 @@ infixl 6 <>
 infixl 6 <+>
 infixl 5 $$, $+$
 
--- Disable ASSERT checks; they are expensive!
-#define LOCAL_ASSERT(x)
-
 
 -- ---------------------------------------------------------------------------
 -- The Doc data type
@@ -588,33 +585,19 @@ mkUnion p q     = p `union_` q
 
 -- Arg of a NilAbove is always an RDoc
 nilAbove_ :: Doc -> Doc
-nilAbove_ p = LOCAL_ASSERT( _ok p ) NilAbove p
-            where
-              _ok Empty = False
-              _ok _     = True
+nilAbove_ = NilAbove
 
 -- Arg of a TextBeside is always an RDoc
 textBeside_ :: TextDetails -> FastInt -> Doc -> Doc
-textBeside_ s sl p = TextBeside s sl (LOCAL_ASSERT( _ok p ) p)
-                   where
-                     _ok (Nest _ _) = False
-                     _ok _          = True
+textBeside_ = TextBeside
 
 -- Arg of Nest is always an RDoc
 nest_ :: FastInt -> Doc -> Doc
-nest_ k p = Nest k (LOCAL_ASSERT( _ok p ) p)
-          where
-            _ok Empty = False
-            _ok _     = True
+nest_ = Nest
 
 -- Args of union are always RDocs
 union_ :: Doc -> Doc -> Doc
-union_ p q = Union (LOCAL_ASSERT( _ok p ) p) (LOCAL_ASSERT( _ok q ) q)
-           where
-             _ok (TextBeside _ _ _) = True
-             _ok (NilAbove _)       = True
-             _ok (Union _ _)        = True
-             _ok _                  = False
+union_ = Union
 
 
 -- ---------------------------------------------------------------------------



More information about the ghc-commits mailing list