<div dir="ltr"><div>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)?<br><br>

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

<br>My simple &amp; unsuccessful attempt is at <a href="https://github.com/conal/plugin-import-id">https://github.com/conal/plugin-import-id</a> . Help greatly appreciated.<br></div><div><br>Thanks,<br><br>  - Conal<br><br>

</div></div>