[commit: ghc] master: minor: use unless instead of (when . not) (bd69f6f)

git at git.haskell.org git at git.haskell.org
Sat Nov 7 23:54:26 UTC 2015


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

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

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

commit bd69f6f4b5b334c5e98aba665bcff63587a5d38d
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sun Nov 8 00:20:26 2015 +0100

    minor: use unless instead of (when . not)
    
    Reviewers: bgamari, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1438


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

bd69f6f4b5b334c5e98aba665bcff63587a5d38d
 compiler/codeGen/StgCmmExpr.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs
index 29db20a..de23443 100644
--- a/compiler/codeGen/StgCmmExpr.hs
+++ b/compiler/codeGen/StgCmmExpr.hs
@@ -47,7 +47,7 @@ import Util
 import FastString
 import Outputable
 
-import Control.Monad (when,void)
+import Control.Monad (unless,void)
 import Control.Arrow (first)
 
 #if __GLASGOW_HASKELL__ >= 709
@@ -295,7 +295,7 @@ cgCase (StgOpApp (StgPrimOp op) args _) bndr (AlgAlt tycon) alts
 
        -- If the binder is not dead, convert the tag to a constructor
        -- and assign it.
-       ; when (not (isDeadBinder bndr)) $ do
+       ; unless (isDeadBinder bndr) $ do
             { dflags <- getDynFlags
             ; tmp_reg <- bindArgToReg (NonVoid bndr)
             ; emitAssign (CmmLocal tmp_reg)
@@ -401,7 +401,7 @@ cgCase (StgApp v []) bndr alt_type@(PrimAlt _) alts
   || reps_compatible
   = -- assignment suffices for unlifted types
     do { dflags <- getDynFlags
-       ; when (not reps_compatible) $
+       ; unless reps_compatible $
            panic "cgCase: reps do not match, perhaps a dodgy unsafeCoerce?"
        ; v_info <- getCgIdInfo v
        ; emitAssign (CmmLocal (idToReg dflags (NonVoid bndr)))



More information about the ghc-commits mailing list