should haddock.ghc be a sub-repo of ghc?
Claus Reinke
claus.reinke at talk21.com
Wed Nov 14 11:06:28 EST 2007
>> 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?
>
> But then it is doing renaming, and it has to understand the complete
> scoping rules of HsSyn. It would be duplicating what GHC's renamer does,
> and risking getting it wrong.
yes, that wouldn't be good. i was hoping that there was a way
to restart the scoping process, or to recall its results during AST
traversal, to deal with the comments in the scope indicated by
their location. but as i know none of the details, i'll stop here;)
aside: while looking into HaddockParse.y, i noticed an
instance Monad (Either String) where
that will propagate all the way to all users of the ghc api!
Prelude GHC Control.Monad.Error> :i Monad
..
instance (Error e) => Monad (Either e)
-- Defined in Control.Monad.Error
..
instance Monad (Either String) -- Defined in HaddockParse
..
which doesn't look like a good idea to me?
>> - debugger listing local environment at breakpoints
>
> what issue are you referring to here? GHCi already lists the local
> variables at a breakpoint, doesn't it?
sorry, should have been clearer:
- (unimplemented, but would be nice):
haddock would like to scope comments in the context
of their locations
- (unimplemented, but often requested):
users would like to use :type in the context of local
bindings
- (implemented, though in a different way):
ghci debugger provides nested ghci sessions in the
context of local bindings in scope at breakpoints
it just seemed to me that these include three instances
of the same general problem. i'm not saying that haddock
should set breakpoints and use the debugger to get the
local environment for parsing its comments. i'm just
saying that the issue is of wider interest to ghc api
users, not just to haddock.
so, if anyone should stumble on a solution, it would
be a nice addition to the ghc api.
claus
More information about the Cvs-ghc
mailing list