; (lhs', lhs_lie, rhs', rhs_lie, rule_ty)
<- tcExtendTyVarEnv tv_bndrs $
tcExtendIdEnv id_bndrs $
- do { ((lhs', rule_ty), lhs_lie) <- getConstraints (tcInferRho lhs)
- ; (rhs', rhs_lie) <- getConstraints (tcMonoExpr rhs rule_ty)
+ do { ((lhs', rule_ty), lhs_lie) <- captureConstraints (tcInferRho lhs)
+ ; (rhs', rhs_lie) <- captureConstraints (tcMonoExpr rhs rule_ty)
; return (lhs', lhs_lie, rhs', rhs_lie, rule_ty) }
; (lhs_dicts, lhs_ev_binds, rhs_ev_binds)
-- Now figure out what to quantify over
-- c.f. TcSimplify.simplifyInfer
- ; zonked_forall_tvs <- zonkTcTyVarsAndFV (varSetElems forall_tvs)
+ ; zonked_forall_tvs <- zonkTcTyVarsAndFV forall_tvs
; gbl_tvs <- tcGetGlobalTyVars -- Already zonked
- ; qtvs <- zonkQuantifiedTyVars (varSetElems (zonked_forall_tvs `minusVarSet` gbl_tvs))
+ ; qtvs <- zonkQuantifiedTyVars $
+ varSetElems (zonked_forall_tvs `minusVarSet` gbl_tvs)
; return (HsRule name act
(map (RuleBndr . noLoc) (qtvs ++ tpl_ids)) -- yuk
-- a::*, x :: a->a
= do { let ctxt = FunSigCtxt (unLoc var)
; (tyvars, ty) <- tcHsPatSigType ctxt rn_ty
- ; let skol_tvs = tcSkolSigTyVars (SigSkol ctxt) tyvars
+ ; let skol_tvs = tcSuperSkolTyVars tyvars
id_ty = substTyWith tyvars (mkTyVarTys skol_tvs) ty
id = mkLocalId (unLoc var) id_ty