Revised signature of tcLookupFamInst and lookupFamInstEnv
[ghc-hetmet.git] / compiler / simplCore / LiberateCase.lhs
index 9b15734..9f03adf 100644 (file)
@@ -23,7 +23,6 @@ import Coercion
 import TyCon
 import VarEnv
 import Name            ( localiseName )
-import Outputable
 import Util             ( notNull )
 import Data.IORef      ( readIORef )
 \end{code}
@@ -275,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
@@ -352,7 +350,7 @@ lookupRecId env id = lookupVarEnv (lc_rec_env env) id
 lookupLevel :: LibCaseEnv -> Id -> LibCaseLevel
 lookupLevel env id
   = case lookupVarEnv (lc_lvl_env env) id of
-      Just lvl -> lc_lvl env
+      Just lvl -> lvl
       Nothing  -> topLevel
 
 freeScruts :: LibCaseEnv
@@ -410,7 +408,7 @@ data LibCaseEnv
 
 initEnv :: DynFlags -> FamInstEnvs -> LibCaseEnv
 initEnv dflags fams
-  = LibCaseEnv { lc_size = libCaseThreshold dflags,
+  = LibCaseEnv { lc_size = specThreshold dflags,
                 lc_lvl = 0,
                 lc_lvl_env = emptyVarEnv, 
                 lc_rec_env = emptyVarEnv,