-
- [(subst, fam_inst)] | variable_only_subst ->
- return (rep_tc, substTyVars subst (tyConTyVars rep_tc))
- where -- NB: assumption is that (tyConTyVars rep_tc) is in
- -- the domain of the substitution
- rep_tc = famInstTyCon fam_inst
- subst_domain = varEnvElts . getTvSubstEnv $ subst
- tvs = map (Type.getTyVar "tcLookupFamInst")
- subst_domain
- variable_only_subst = all Type.isTyVarTy subst_domain &&
- sizeVarSet (mkVarSet tvs) == length tvs
- -- renaming may have no repetitions
-
- other -> famInstNotFound tycon tys other
+ [(fam_inst, rep_tys)] -> return (famInstTyCon fam_inst, rep_tys)
+ other -> famInstNotFound tycon tys other