Exposing newtype coercions to Haskell
nicolas.frisby at gmail.com
Tue Jul 2 19:56:24 CEST 2013
This is an exciting effort! Just a quick reaction to Simon's comments on
On Tue, Jul 2, 2013 at 9:11 AM, Simon Peyton-Jones <simonpj at 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
> (mg_tcs guts)
> (mg_fam_insts guts)
and it has worked so far.
HTH and good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users