builtin,
GlobalEnv(..),
+ setInstEnvs,
readGEnv, setGEnv, updGEnv,
LocalEnv(..),
, global_bindings = []
}
+setInstEnvs :: InstEnv -> FamInstEnv -> GlobalEnv -> GlobalEnv
+setInstEnvs l_inst l_fam_inst genv
+ | (g_inst, _) <- global_inst_env genv
+ , (g_fam_inst, _) <- global_fam_inst_env genv
+ = genv { global_inst_env = (g_inst, l_inst)
+ , global_fam_inst_env = (g_fam_inst, l_fam_inst) }
+
emptyLocalEnv = LocalEnv {
local_vars = emptyVarEnv
, local_tyvars = []
$ maybeV (readGEnv $ \env -> lookupVarEnv (global_vars env) v)
lookupTyCon :: TyCon -> VM (Maybe TyCon)
-lookupTyCon tc = readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
+lookupTyCon tc
+ | isUnLiftedTyCon tc || isTupleTyCon tc = return (Just tc)
+
+ | otherwise = readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
defTyCon :: TyCon -> TyCon -> VM ()
defTyCon tc tc' = updGEnv $ \env ->