[commit: ghc] wip/T12618: knownCon: Use ConApp in unfolding of scrutinee (c3e1cb0)

git at git.haskell.org git at git.haskell.org
Thu Oct 6 23:20:13 UTC 2016


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

On branch  : wip/T12618
Link       : http://ghc.haskell.org/trac/ghc/changeset/c3e1cb0b94f527d2a488c19b4566a46cd7d780ce/ghc

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

commit c3e1cb0b94f527d2a488c19b4566a46cd7d780ce
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Oct 4 14:41:54 2016 -0400

    knownCon: Use ConApp in unfolding of scrutinee


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

c3e1cb0b94f527d2a488c19b4566a46cd7d780ce
 compiler/simplCore/Simplify.hs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs
index 479b18c..a966986 100644
--- a/compiler/simplCore/Simplify.hs
+++ b/compiler/simplCore/Simplify.hs
@@ -25,7 +25,7 @@ import Name             ( Name, mkSystemVarName, isExternalName, getOccFS )
 import Coercion hiding  ( substCo, substCoVar )
 import OptCoercion      ( optCoercion )
 import FamInstEnv       ( topNormaliseType_maybe )
-import DataCon          ( DataCon, dataConWorkId, dataConRepStrictness
+import DataCon          ( DataCon, dataConRepStrictness
                         , isMarkedStrict, dataConRepArgTys ) --, dataConTyCon, dataConTag, fIRST_TAG )
 --import TyCon            ( isEnumerationTyCon ) -- temporalily commented out. See #8326
 import CoreMonad        ( Tick(..), SimplifierMode(..) )
@@ -2330,9 +2330,7 @@ knownCon env scrut dc dc_ty_args dc_args bndr bs rhs cont
       | otherwise           = do { dc_args <- mapM (simplVar env) bs
                                          -- dc_ty_args are aready OutTypes,
                                          -- but bs are InBndrs
-                                 ; let con_app = Var (dataConWorkId dc)
-                                                 `mkTyApps` dc_ty_args
-                                                 `mkApps`   dc_args
+                                 ; let con_app = ConApp dc (map Type dc_ty_args ++ dc_args)
                                  ; simplNonRecX env bndr con_app }
 
 -------------------



More information about the ghc-commits mailing list