- = (dc_tvs ++ mkTemplateLocalsNum arg_base (mkPredTys dc_theta),
- mkTemplateLocalsNum arg_base' dc_arg_tys)
-
- (pre_dc_tvs, pre_dc_theta, dc_arg_tys) = dataConSig data_con
- -- again we need to pull the EqPreds out of dc_theta, into dc_tvs
- dc_eqvars = map (mkWildCoVar . mkPredTy . fixEqPred) (filter isEqPred pre_dc_theta)
- -- The type of the record selector Id does not contain the univ tvs
- -- but rather their substitution according to the eq_spec. Therefore
- -- the coercion arguments bound in the case alternative will just
- -- have reflexive coercion kinds
- fixEqPred (EqPred ty1 ty2) = EqPred ty2 ty2
- dc_tvs = drop (length (dataConUnivTyVars data_con)) pre_dc_tvs ++ dc_eqvars
+ = (ex_tvs ++ co_tvs ++ dict_vs, field_vs)
+
+ (ex_tvs, co_tvs, arg_vs) = dataConInstPat uniqs' data_con res_tys
+ (dict_vs, field_vs) = splitAt (length dc_theta) arg_vs
+
+ (_, pre_dc_theta, dc_arg_tys) = dataConSig data_con