<p dir="ltr">Hi,</p>
<p dir="ltr">IIRC you can already use hscFrontendHook in the DynFlags hooks to retrieve TcGblEnv, and with a little bit of work, also HsParsedModule.</p>
<p dir="ltr">Regards,<br>
Shao Cheng</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 19, 2018, 5:41 PM Matthew Pickering <<a href="mailto:matthewtpickering@gmail.com">matthewtpickering@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have too wanted this in the past and made a post to a similar effect<br>
on the mailing list 6 months ago.<br>
<br>
<a href="https://mail.haskell.org/pipermail/ghc-devs/2017-July/014427.html" rel="noreferrer" target="_blank">https://mail.haskell.org/pipermail/ghc-devs/2017-July/014427.html</a><br>
<br>
It references this proposal for a similar feature.<br>
<br>
<a href="https://ghc.haskell.org/trac/ghc/wiki/FrontendPluginsProposal#no1" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/wiki/FrontendPluginsProposal#no1</a><br>
<br>
If you would be glad to implement it then feel free to add me as a reviewer.<br>
<br>
Cheers,<br>
<br>
Matt<br>
<br>
On Fri, Jan 19, 2018 at 9:35 AM, Németh Boldizsár <<a href="mailto:nboldi@elte.hu" target="_blank">nboldi@elte.hu</a>> wrote:<br>
> Dear GHC Developers,<br>
><br>
> I would like to ask your opinion on my ideas to make it easier to use<br>
> development tools with GHC.<br>
><br>
> In the past when working on a Haskell refactoring tool I relied on using the<br>
> GHC API for parsing and type checking Haskell sources. I extracted the<br>
> representation and performed analysis and transformation on it as it was<br>
> needed. However using the refactorer would be easier if it could work with<br>
> build tools.<br>
><br>
> To do this, my idea is to instruct GHC with a compilation flag to give out<br>
> its internal representation of the source code. Most build tools let the<br>
> user to configure the GHC flags so the refactoring tool would be usable in<br>
> any build infrastructure. I'm thinking of using the pre-existing plugin<br>
> architecture and adding two new fields to the Plugin datastructure. One<br>
> would be called with the parsed representation (HsParsedModule) when parsing<br>
> succeeds, another with the result of the type checking (TcGblEnv) when type<br>
> checking is finished.<br>
><br>
> What do you think about this solution?<br>
><br>
> Boldizsár<br>
><br>
> (ps: My first idea was using frontend plugins, but I could not access the<br>
> representation from there and --frontend flag changed GHC compilation mode.)<br>
><br>
> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>