2009/4/1 Colin Paul Adams <[email protected]>:
> 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
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
  • doCorePass Colin Paul Adams
    • Re: doCorePass Max Bolingbroke

Reply via email to