
2009/4/1 Colin Paul Adams
Between 6.8 and 6.11, function doCorePass in module SimplCore has changed types from:
CoreToDo -> HscEnv -> UniqSupply -> RuleBase -> ModGuts -> IO (SimplCount, ModGuts)
to:
CorePass (== CoreToDo) -> ModGuts -> CoreM ModGuts
The file to look at is CoreMonad.lhs. In particular, these functions exist: -- ** Reading from the monad getHscEnv, getAnnEnv, getRuleBase, getModule, getDynFlags, getOrigNameCache, liftIOWithCount And it is an instance of MonadUnique so has getUniqueSupplyM. This suggests the following implementation: lift :: (CoreToDo -> HscEnv -> UniqSupply -> RuleBase -> ModGuts -> IO (SimplCount, ModGuts)) -> CorePass -> ModGuts -> CoreM ModGuts lift f pass guts = do env <- getHscEnv us <- getUniqueSupplyM rb <- getRuleBase liftIOWithCount (f pass env us rb guts) Disclaimer: I have not run this or even type checked it :-) Cheers, Max