Extracting representation from GHC
astrohavoc at gmail.com
Fri Jan 19 12:03:04 UTC 2018
IIRC you can already use hscFrontendHook in the DynFlags hooks to retrieve
TcGblEnv, and with a little bit of work, also HsParsedModule.
On Fri, Jan 19, 2018, 5:41 PM Matthew Pickering <matthewtpickering at gmail.com>
> I have too wanted this in the past and made a post to a similar effect
> on the mailing list 6 months ago.
> It references this proposal for a similar feature.
> If you would be glad to implement it then feel free to add me as a
> On Fri, Jan 19, 2018 at 9:35 AM, Németh Boldizsár <nboldi at elte.hu> wrote:
> > Dear GHC Developers,
> > I would like to ask your opinion on my ideas to make it easier to use
> > development tools with GHC.
> > In the past when working on a Haskell refactoring tool I relied on using
> > GHC API for parsing and type checking Haskell sources. I extracted the
> > representation and performed analysis and transformation on it as it was
> > needed. However using the refactorer would be easier if it could work
> > build tools.
> > To do this, my idea is to instruct GHC with a compilation flag to give
> > its internal representation of the source code. Most build tools let the
> > user to configure the GHC flags so the refactoring tool would be usable
> > any build infrastructure. I'm thinking of using the pre-existing plugin
> > architecture and adding two new fields to the Plugin datastructure. One
> > would be called with the parsed representation (HsParsedModule) when
> > succeeds, another with the result of the type checking (TcGblEnv) when
> > checking is finished.
> > What do you think about this solution?
> > Boldizsár
> > (ps: My first idea was using frontend plugins, but I could not access the
> > representation from there and --frontend flag changed GHC compilation
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> ghc-devs mailing list
> ghc-devs at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs