[Haskell-cafe] ghc-api Static Semantics?

Ozgur Akgun ozgurakgun at gmail.com
Mon Jan 23 21:38:27 CET 2012


I don't know what you actually need, but if haskell-src-exts is an option,
it is quite a bit easier to use (definitely easier to understand for me!).
Especially when used together with Uniplate.

For example, for a given piece of AST one can get all the identifiers used
like so:

[ x | Ident x <- universeBi ast ]

Finding where they are bound shouldn't be very hard either.

Hope this helps,

On 23 January 2012 17:33, Christopher Brown <cmb21 at st-andrews.ac.uk> wrote:

> Hi,
> I was wondering if anyone could tell me if it's possible to get an AST
> from the ghc-api decorated with static-semantics?
> In particular, I am interested in use and bind locations for all names in
> the AST together with the module they are bound, etc.
> Looking through the online docs, there doesn't seem to be a way to do this.
> Even if I can tell from the AST where a variable is bound that would be
> enough,  if this is by making all names unique and qualified that would be
> better than nothing.
> Hope someone can help,
> Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120123/e0894327/attachment.htm>

More information about the Haskell-Cafe mailing list