[commit: ghc] wip/T12618: Desugar: Use Coercible worker, not wrapper (5be97a0c)

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


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

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

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

commit 5be97a0c7aec64260335581ec8de27792be0467a
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Oct 5 13:21:41 2016 -0400

    Desugar: Use Coercible worker, not wrapper


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

5be97a0c7aec64260335581ec8de27792be0467a
 compiler/deSugar/Desugar.hs | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs
index 6a6c012..16fdc5d 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -42,7 +42,6 @@ import TysPrim     ( eqReprPrimTyCon )
 import Unique      ( hasKey )
 import Coercion    ( mkCoVarCo )
 import TysWiredIn  ( coercibleDataCon )
-import DataCon     ( dataConWrapId )
 import MkCore      ( mkCoreLet )
 import Module
 import NameSet
@@ -642,9 +641,7 @@ unfold_coerce bndrs lhs rhs = do
             let ty' = mkTyConApp eqReprPrimTyCon [k, k, t1, t2]
                 v'  = mkLocalCoVar
                         (mkDerivedInternalName mkRepEqOcc u (getName v)) ty'
-                box = Var (dataConWrapId coercibleDataCon) `mkTyApps`
-                      [k, t1, t2] `App`
-                      Coercion (mkCoVarCo v')
+                box = mkConApp coercibleDataCon (map Type [k, t1, t2] ++  [Coercion (mkCoVarCo v')])
 
             (bndrs, wrap) <- go vs
             return (v':bndrs, mkCoreLet (NonRec v box) . wrap)



More information about the ghc-commits mailing list