diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2007-05-14 06:52:34 +0000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2007-05-14 06:52:34 +0000 |
commit | 4899cc823373bd016a49cdb0dffd0e22150ec07e (patch) | |
tree | 74985f4ceb57e7140f782129fb236ed4c844d66f /compiler/simplCore/LiberateCase.lhs | |
parent | d81eedc942376d81428293a67e99a80676222e39 (diff) | |
download | haskell-4899cc823373bd016a49cdb0dffd0e22150ec07e.tar.gz |
Revised signature of tcLookupFamInst and lookupFamInstEnv
- This changes the signature of FamInstEnv.lookupFamInstEnv and
FamInstEnv.lookupFamInstEnvUnify in a manner similar to SPJ's
previous patch for InstEnv.llokupInstEnv
- tcLookupFamInst now permits the lookup of instances that are more
general than the type instance requested.
Diffstat (limited to 'compiler/simplCore/LiberateCase.lhs')
-rw-r--r-- | compiler/simplCore/LiberateCase.lhs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/simplCore/LiberateCase.lhs b/compiler/simplCore/LiberateCase.lhs index a7b613dbb5..9f03adfe1d 100644 --- a/compiler/simplCore/LiberateCase.lhs +++ b/compiler/simplCore/LiberateCase.lhs @@ -274,10 +274,9 @@ mkCase :: LibCaseEnv -> CoreExpr -> Id -> Type -> [CoreAlt] -> CoreExpr -- See Note [Indexed data types] mkCase env scrut bndr ty [(DEFAULT,_,rhs)] | Just (tycon, tys) <- splitTyConApp_maybe (idType bndr) - , [(subst, fam_inst)] <- lookupFamInstEnv (lc_fams env) tycon tys + , [(fam_inst, rep_tys)] <- lookupFamInstEnv (lc_fams env) tycon tys = let rep_tc = famInstTyCon fam_inst - rep_tys = map (substTyVar subst) (tyConTyVars rep_tc) bndr' = setIdType bndr (mkTyConApp rep_tc rep_tys) Just co_tc = tyConFamilyCoercion_maybe rep_tc co = mkTyConApp co_tc rep_tys |