diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-10-06 17:16:50 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-10-06 17:16:50 -0400 |
commit | 5abaa92b73046bddcb7ef83f09704cc3c6dd13f7 (patch) | |
tree | e9892e8c66ee10e3eacafe8735d6f3b40e7e2556 | |
parent | d475343c9edec655a814746fb253d6805138f5b0 (diff) | |
download | haskell-wip/T12919.tar.gz |
Second optimizationwip/T12919
-rw-r--r-- | compiler/typecheck/TcFlatten.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index 6730d0b8fd..3e7b998bbc 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -1183,6 +1183,7 @@ flatten_args orig_binders orig_inner_ki orig_fvs orig_roles orig_tys ppr orig_tys]) flatten_args orig_binders orig_inner_ki orig_fvs orig_roles orig_tys + -- Slow path: = go [] [] orig_lc orig_binders orig_inner_ki orig_roles orig_tys where orig_lc = emptyLiftingContext $ mkInScopeSet $ orig_fvs @@ -1200,7 +1201,10 @@ flatten_args orig_binders orig_inner_ki orig_fvs orig_roles orig_tys = return (reverse acc_xis, reverse acc_cos, kind_co) where final_kind = mkPiTys binders inner_ki - kind_co = liftCoSubst Nominal lc final_kind + kind_co + -- liftCoSubst only necessary if kind has free variables + | isEmptyVarSet orig_fvs = mkReflCo Nominal final_kind + | otherwise = liftCoSubst Nominal lc final_kind go acc_xis acc_cos lc (binder:binders) inner_ki (role:roles) (ty:tys) = do { (xi, co) <- case role of |