please find attached the diffs and files for implementing :browse!,
a slightly more detailed variant of :browse. from the user guide:

If the ! symbol is appended to the command, data constructors and class methods will be listed individually, otherwise, they will only be listed in the context of their data type or class declaration. The !-form also annotates the listing with comments giving possible imports for each group of entries.

[note: giving the import information would also be useful for :info]

i've just done a rebuild and test (fast stage=2) and there seem
to be no adverse effects (although i wonder whether the new
getGRE in GHC.hs shouldn't be exported all the time, to avoid
a warning?).

this fixes the first two issues mentioned in #1617, namely
listing children with their full types, and providing import
information for unqualified identifiers. the third issue, that
reload doesn't seem to update :browse information, remains.

there are still some issues with :browse in general, which are
mostly shared by :browse!, but are not specific to the new
functionality, including:

   - printing TyThings for class methods seems troublesome;

:browse uses printTyThingInContext, which avoids dealing with the nested foralls in the type representation,
       but still can give erroneous information when dropping
       foralls

       :browse! uses printTyThing for classes, which results
       in the same issue, but uses exprType to list individual
       class methods (this workaround should be temporary,
until the printTyThingies are fixed, at least it gives valid types, but with possibly simplified contexts, rather than the precise form given by the user)

   - :browse[!] should only list children if their parent is
       imported as Parent(..), not otherwise

   - the order of entries is strangely incoherent

please adopt for head and stable.

thanks,
claus

Attachment: ghci-browse-bang.diff
Description: Binary data

Attachment: ghci-browse-bang-testsuite.diff
Description: Binary data

Attachment: ghci022.stdout
Description: Binary data

Attachment: ghci022.hs
Description: Binary data

Attachment: ghci022.script
Description: Binary data

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to