-dataConInstPat arg_fun uniqs con inst_tys
- = dataConOccInstPat arg_fun uniqs occs con inst_tys
- where
- -- dataConOccInstPat doesn't actually make use of the OccName directly for
- -- existential and coercion variable binders, so it is right to just
- -- use the VarName namespace for all of the OccNames
- occs = mk_occs 1
- mk_occs n = mkVarOcc ("ipv" ++ show n) : mk_occs (n+1)
-
-dataConOccInstPat :: (DataCon -> [Type]) -- function used to find arg tys
- -> [Unique] -- A long enough list of uniques, at least one for each binder
- -> [OccName] -- An equally long list of OccNames to use
- -> DataCon
- -> [Type] -- Types to instantiate the universally quantified tyvars
- -> ([TyVar], [CoVar], [Id]) -- Return instantiated variables
--- This function actually does the job specified in the comment for
--- dataConInstPat, but uses the specified list of OccNames. This is
--- is necessary for use in e.g. tcIfaceDataAlt
-dataConOccInstPat arg_fun uniqs occs con inst_tys