X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FMatchCon.lhs;h=90675fb41921ef76bb03e5a097805b61fa42b311;hb=958924a2b338aebbcc8a88ba2cab511517762a19;hp=a84c96d198cc08fabf27dd60782ef06d9189ab45;hpb=ed75b2fd12799f62ea76ae43ebaa46d04f70db3d;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/MatchCon.lhs b/ghc/compiler/deSugar/MatchCon.lhs index a84c96d..90675fb 100644 --- a/ghc/compiler/deSugar/MatchCon.lhs +++ b/ghc/compiler/deSugar/MatchCon.lhs @@ -10,11 +10,11 @@ module MatchCon ( matchConFamily ) where import {-# SOURCE #-} Match ( match ) -import HsSyn ( Pat(..), HsConDetails(..), isEmptyLHsBinds ) -import DsBinds ( dsHsNestedBinds ) -import DataCon ( isVanillaDataCon, dataConTyVars, dataConOrigArgTys ) +import HsSyn ( Pat(..), HsConDetails(..) ) +import DsBinds ( dsLHsBinds ) +import DataCon ( isVanillaDataCon, dataConInstOrigArgTys ) import TcType ( tcTyConAppArgs ) -import Type ( substTys, zipTopTvSubst, mkTyVarTys ) +import Type ( mkTyVarTys ) import CoreSyn import DsMonad import DsUtils @@ -125,7 +125,7 @@ match_con vars ty eqns shift eqn@(EqnInfo { eqn_wrap = wrap, eqn_pats = ConPatOut _ tvs ds bind (PrefixCon arg_pats) _ : pats }) - = do { prs <- dsHsNestedBinds bind + = do { prs <- dsLHsBinds bind ; return (eqn { eqn_wrap = wrap . wrapBinds (tvs `zip` tvs1) . wrapBinds (ds `zip` dicts1) . mkDsLet (Rec prs), @@ -134,8 +134,7 @@ match_con vars ty eqns -- Get the arg types, which we use to type the new vars -- to match on, from the "outside"; the types of pats1 may -- be more refined, and hence won't do - arg_tys = substTys (zipTopTvSubst (dataConTyVars con) inst_tys) - (dataConOrigArgTys con) + arg_tys = dataConInstOrigArgTys con inst_tys inst_tys | isVanillaDataCon con = tcTyConAppArgs pat_ty -- Newtypes opaque! | otherwise = mkTyVarTys tvs1 \end{code}