in-tree API Annotations

Alan & Kim Zimmerman alan.zimm at
Tue May 26 07:33:59 UTC 2020

And to reply to my own question, yes we do, we use them to tie up the
ParsedSource RdrName to the renamed Name when considering refactorings.

On Mon, 25 May 2020 at 23:33, Alan & Kim Zimmerman <alan.zimm at>

> I am trying to get my head around the best way to put the API annotations
> into the GHC ParsedSource directly, so ghc-exactprint can move in to GHC
> and make the development/testing process easier.
> Prior to API Annotations, there were very few locations in the AST, as
> they were added as anchor points for the annotations, being separate from
> the AST and indexed to it by the SrcSpan.
> I am intending to strip out the superfluous ones, in particular all the
> (Located RdrName), replacing them with something like
>   data ApiAnnName a = N ApiAnn a
> instead. So they would still be wrapped, but the annotations would be only
> ones that can occur for a RdrName, such a backticks, parens, and so on.
> Does anything actually need these locations now they are there?  I am
> thinking specifically of the .hie files, as the `toHie` instances seem to
> make use of locations extensively.
> Regards
>   Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list