non_upd_field_lbls = concat relevant_field_lbls_s `minusList` upd_field_lbls
common_tyvars = tyVarsOfTypes (map fieldLabelType non_upd_field_lbls)
- mk_inst_ty (tyvar, result_inst_ty)
+ mk_inst_ty tyvar result_inst_ty
| tyvar `elemVarSet` common_tyvars = returnM result_inst_ty -- Same as result type
| otherwise = newTyVarTy liftedTypeKind -- Fresh type
in
- mappM mk_inst_ty (zip tycon_tyvars result_inst_tys) `thenM` \ inst_tys ->
+ zipWithM mk_inst_ty tycon_tyvars result_inst_tys `thenM` \ inst_tys ->
-- STEP 5
-- Typecheck the expression to be updated
-- and say so.
-- The ~(Check...) is because in the Infer case the tcSubExp
-- definitely won't fail, so we can be certain we're in the Check branch
-checkArgsCtxt fun args ~(Check expected_res_ty) actual_res_ty tidy_env
+checkArgsCtxt fun args (Infer _) actual_res_ty tidy_env
+ = return (tidy_env, ptext SLIT("Urk infer"))
+
+checkArgsCtxt fun args (Check expected_res_ty) actual_res_ty tidy_env
= zonkTcType expected_res_ty `thenM` \ exp_ty' ->
zonkTcType actual_res_ty `thenM` \ act_ty' ->
let