[commit: ghc] master: Replace mkTvSubstPrs (a `zip` b) with zipTvSubst a b (d27da53)

git at git.haskell.org git at git.haskell.org
Wed Feb 10 17:12:45 UTC 2016


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

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

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

commit d27da53652a6ba01c91856859a4be674fe3c835d
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Wed Feb 10 08:12:44 2016 -0800

    Replace mkTvSubstPrs (a `zip` b) with zipTvSubst a b
    
    It's just a small cleanup. There should be no change in
    behaviour.
    
    Test Plan: ./validate --slow
    
    Reviewers: austin, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: thomie, simonmar
    
    Differential Revision: https://phabricator.haskell.org/D1901


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

d27da53652a6ba01c91856859a4be674fe3c835d
 compiler/basicTypes/MkId.hs | 2 +-
 compiler/deSugar/DsExpr.hs  | 2 +-
 compiler/typecheck/TcPat.hs | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 8aaa005..7dfc0b0 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -563,7 +563,7 @@ mkDataConRep dflags fam_envs wrap_name mb_bangs data_con
     mk_boxer :: [Boxer] -> DataConBoxer
     mk_boxer boxers = DCB (\ ty_args src_vars ->
                       do { let (ex_vars, term_vars) = splitAtList ex_tvs src_vars
-                               subst1 = mkTvSubstPrs (univ_tvs `zip` ty_args)
+                               subst1 = zipTvSubst univ_tvs ty_args
                                subst2 = extendTCvSubstList subst1 ex_tvs
                                                            (mkTyVarTys ex_vars)
                          ; (rep_ids, binds) <- go subst2 boxers term_vars
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs
index 6d4b0d9..9219d7e 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/deSugar/DsExpr.hs
@@ -623,7 +623,7 @@ dsExpr expr@(RecordUpd { rupd_expr = record_expr, rupd_flds = fields
     mk_alt upd_fld_env con
       = do { let (univ_tvs, ex_tvs, eq_spec,
                   prov_theta, _req_theta, arg_tys, _) = conLikeFullSig con
-                 subst = mkTvSubstPrs (univ_tvs `zip` in_inst_tys)
+                 subst = zipTvSubst univ_tvs in_inst_tys
 
                 -- I'm not bothering to clone the ex_tvs
            ; eqs_vars   <- mapM newPredVarDs (substTheta subst (eqSpecPreds eq_spec))
diff --git a/compiler/typecheck/TcPat.hs b/compiler/typecheck/TcPat.hs
index 2dddd6b..4d1d09a 100644
--- a/compiler/typecheck/TcPat.hs
+++ b/compiler/typecheck/TcPat.hs
@@ -1011,7 +1011,7 @@ addDataConStupidTheta data_con inst_tys
         -- The origin should always report "occurrence of C"
         -- even when C occurs in a pattern
     stupid_theta = dataConStupidTheta data_con
-    tenv = mkTvSubstPrs (dataConUnivTyVars data_con `zip` inst_tys)
+    tenv = zipTvSubst (dataConUnivTyVars data_con) inst_tys
          -- NB: inst_tys can be longer than the univ tyvars
          --     because the constructor might have existentials
     inst_theta = substTheta tenv stupid_theta



More information about the ghc-commits mailing list