Exposing newtype coercions to Haskell

Joachim Breitner mail at joachim-breitner.de
Wed Jul 3 12:33:11 CEST 2013


Hi,

Am Dienstag, den 02.07.2013, 12:56 -0500 schrieb Nicolas Frisby:

> 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.

strange, why did I miss that?

But I can’t get it to work, even looking up an element that I took from
the GRE itself returns []:

    let e' = head (head (occEnvElts env))
    putMsgS $ showSDoc dflags (ppr e')
    putMsgS $ showSDoc dflags (ppr (lookupGRE_RdrName (nameRdrName (gre_name e')) env))

prints:
        
        GHC.NT.Type.NT
          imported from `GHC.NT.Type' at GHC/NT.hs:5:1-18
          (and originally defined at GHC/NT/Type.hs:6:6-7)
        []
        
Also, trying to construct a RdrName that I can look up fails:

    let rdrName = mkRdrQual (mkModuleName "GHC.NT.Type") (mkTcOcc "NT")
    putMsgS $ showSDoc dflags (ppr (lookupGRE_RdrName rdrName env))

prints also just [].

What am I doing wrong?

Thanks,
Joachim
        

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20130703/d4e899ac/attachment.pgp>


More information about the Glasgow-haskell-users mailing list