That'd be quite tricky, because different names are in scope in
different places. E.g. 'a' means two different things in (f a (\a.a)).
I'd forgotten about Names in Haddock comments -- they make a good reason
not to treat Haddock comments as opaque strings.

Hmm, but in a haddock comment, the only names that should get hyperlinks
are top-level exported/imported entities.  The RdrName stuff can only be
used to resolve qualified names (again all top-level entities) I think.
None of the other scopes matter to Haddock.

That's true. Haddock only really needs the top-level namespace of the module to resolve names, so it is possible to rename the Haddock comments later, after typechecking. GHC retains the top level scope of each module as a GlobalRdrEnv so that it can be used in GHCi.

is there no way for haddock to extract any local names
by traversing the AST fragment (in which those local
names have been resolved properly) the comment is attached/next to?

btw, this does look related to two popular ghci issues:

- show/browse types of local identifiers
- debugger listing local environment at breakpoints

claus


_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to