[commit: ghc] master: Rmove a call to mkStatePrimTy (ff1544d)

git at git.haskell.org git at git.haskell.org
Tue Dec 19 15:29:49 UTC 2017


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

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

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

commit ff1544d6db26c16d801f9cf9197db6eede57d576
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Dec 19 10:37:13 2017 +0000

    Rmove a call to mkStatePrimTy
    
    This is a tiny refactoring that removes one of the calls
    to mkStatePrimTy, in service to Trac #14596


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

ff1544d6db26c16d801f9cf9197db6eede57d576
 compiler/prelude/PrelRules.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs
index 8838c4a..db79589 100644
--- a/compiler/prelude/PrelRules.hs
+++ b/compiler/prelude/PrelRules.hs
@@ -40,7 +40,7 @@ import TysPrim
 import TyCon       ( tyConDataCons_maybe, isEnumerationTyCon, isNewTyCon
                    , unwrapNewTyCon_maybe, tyConDataCons )
 import DataCon     ( DataCon, dataConTagZ, dataConTyCon, dataConWorkId )
-import CoreUtils   ( cheapEqExpr, exprIsHNF )
+import CoreUtils   ( cheapEqExpr, exprIsHNF, exprType )
 import CoreUnfold  ( exprIsConApp_maybe )
 import Type
 import OccName     ( occNameFS )
@@ -932,9 +932,9 @@ dataToTagRule = a `mplus` b
 -- seq# :: forall a s . a -> State# s -> (# State# s, a #)
 seqRule :: RuleM CoreExpr
 seqRule = do
-  [Type ty_a, Type ty_s, a, s] <- getArgs
+  [Type ty_a, Type _ty_s, a, s] <- getArgs
   guard $ exprIsHNF a
-  return $ mkCoreUbxTup [mkStatePrimTy ty_s, ty_a] [s, a]
+  return $ mkCoreUbxTup [exprType s, ty_a] [s, a]
 
 -- spark# :: forall a s . a -> State# s -> (# State# s, a #)
 sparkRule :: RuleM CoreExpr



More information about the ghc-commits mailing list