This is an exciting effort! Just a quick reaction to Simon's comments on
CoreM.

On Tue, Jul 2, 2013 at 9:11 AM, Simon Peyton-Jones <simo...@microsoft.com>wrote:

>  To your questions:
>
> **
>
> **ยท        **To do these kind of things, CoreM will need more reader
> stuff.  In particular:****
>
> **o   **The global TypeEnv****
>
> **o   **The GlobalRdrEnv
>
For my light experimentation, I have recovered these two values from the
ModGuts that all plugins receive. Hopefully someone will shout out if
there's pitfalls to avoid.

  * The mg_rdr_env field is of type GlobalRdrEnv.

  * compiler/main/GHC.hs defines a function compileCore with a local
definition that rebuilds a TypeEnv. I extracted this:

> \guts -> HscTypes.typeEnvFromEntities (CoreSyn.bindersOfBinds (mg_binds
guts))
>                                            (mg_tcs guts)
>                                            (mg_fam_insts guts)

and it has worked so far.

HTH and good luck!
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to