[Haddock] Fwd: Fully qualified identifiers

Isaac Dupree ml at isaac.cedarswampstudios.org
Fri Aug 27 03:11:24 EDT 2010


On 08/26/10 07:46, David Waern wrote:
> I think doing all of the above is a good warmup before tackling the
> slightly harder problem of Original qualification. I don't know if the
> original qualification is available in the GHC Name/OccName. If not
> then we will have to add this information to Haddock's DocName type
> somehow.

If you can't get it out of a GHC Name, it will be tricky to find the 
information by the time that we are converting Name to DocName. -- i.e. 
the information may only be available in/before the GHC-renamer pass 
that turns RdrNames into Names, called from Haddock.Interface.Rn module. 
  Note that Haddock-renaming from Name to DocName is different, and has 
to come noticably later in the process (Haddock haddocks a group of 
modules in one go, and Haddock-renaming comes after all individual 
modules have each been processed, Haddock.Interface.Create, including 
GHC-renaming). ghc:RdrName.nameRdrName is *not* what you want (check its 
source) (also checking ghc:Name.Name source makes it look that Names 
have completely forgotten that information...)  You could try 
introducing an intermediate type between Name and DocName that you 
produce in Haddock.Interface.Rn (it should be easy, the monad is only Id 
and all the code does is a few lookups in an unchanging environment); 
changing that name-type might be messy in other parts of the code, or 
not (try GHC.getName, and make sure your intermediate type is an 
instance of GHC.NamedThing)

-Isaac



More information about the Haddock mailing list