From: Matthijs Kooijman Date: Sun, 21 Jun 2009 14:47:51 +0000 (+0200) Subject: Change the debug output of applyboth a bit. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=a4d372dbdfce2a3bddfda1c352f8dd05146f4f71;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Change the debug output of applyboth a bit. --- diff --git a/NormalizeTools.hs b/NormalizeTools.hs index 82da086..58432d3 100644 --- a/NormalizeTools.hs +++ b/NormalizeTools.hs @@ -63,11 +63,16 @@ applyboth first (name, second) expr = do expr' <- first expr -- Apply the second (expr'', changed) <- Writer.listen $ second expr' - if Monoid.getAny changed + if Monoid.getAny $ + -- trace ("Trying to apply transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n") $ + changed then - trace ("Transform " ++ name ++ " changed from:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n" ++ "\nTo:\n" ++ showSDoc (nest 4 $ ppr expr'') ++ "\n" ++ "Type: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr'') ++ "\n" ) $ - applyboth first (name, second) expr'' +-- trace ("Applying transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n") $ + -- trace ("Result of applying " ++ name ++ ":\n" ++ showSDoc (nest 4 $ ppr expr'') ++ "\n" ++ "Type: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr'') ++ "\n" ) $ + applyboth first (name, second) $ + expr'' else + -- trace ("No changes") $ return expr'' -- Apply the given transformation to all direct subexpressions (only), not the