import HscTypes hiding ( MonadThings(..) )
import Module ( PackageId )
import CoreSyn
-import CoreUnfold ( mkInlineRule )
+import CoreUnfold ( mkInlineUnfolding )
import CoreFVs
import CoreMonad ( CoreM, getHscEnv )
-import FamInstEnv ( extendFamInstEnvList )
import Var
import Id
import OccName
import BasicTypes ( isLoopBreaker )
import Outputable
import Util ( zipLazy )
+import MonadUtils
+
import Control.Monad
debug = False
-- TODO: What new binds do we get back here?
(types', fam_insts, tc_binds) <- vectTypeEnv (mg_types guts)
- -- TODO: What is this?
- let fam_inst_env' = extendFamInstEnvList (mg_fam_inst_env guts) fam_insts
- updGEnv (setFamInstEnv fam_inst_env')
+ (_, fam_inst_env) <- readGEnv global_fam_inst_env
-- dicts <- mapM buildPADict pa_insts
-- workers <- mapM vectDataConWorkers pa_insts
return $ guts { mg_types = types'
, mg_binds = Rec tc_binds : binds'
- , mg_fam_inst_env = fam_inst_env'
+ , mg_fam_inst_env = fam_inst_env
, mg_fam_insts = mg_fam_insts guts ++ fam_insts
}
vty <- vectType (idType var)
-- Make the vectorised version of binding's name, and set the unfolding used for inlining.
- var' <- liftM (`setIdUnfolding` unfolding)
+ var' <- liftM (`setIdUnfoldingLazily` unfolding)
$ cloneId mkVectOcc var vty
-- Add the mapping between the plain and vectorised name to the state.
return var'
where
unfolding = case inline of
- Inline arity -> mkInlineRule expr (Just arity)
+ Inline arity -> mkInlineUnfolding (Just arity) expr
DontInline -> noUnfolding