Module import and use in GHC plugin?

Conal Elliott conal at conal.net
Wed May 29 23:37:40 CEST 2013


In writing GHC plugins, how can I (a) add a module import (preferably
qualified) and (b) make vars/ids for names imported from the newly imported
module (to insert in the transformed Core code)?

If it's not possible to do what I want, I'd be willing to require an
explicit import (say "import qualified Foo") in client code, as a temporary
workaround.
So far I've been unable to import even from the base package. Maybe I'm
missing something basic that you folks have learned.

My simple & unsuccessful attempt is at
https://github.com/conal/plugin-import-id . Help greatly appreciated.

Thanks,

  - Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130529/d2bfc468/attachment.htm>


More information about the ghc-devs mailing list