patches/diffs for full :browse! (fixes most of #1617)
Claus Reinke
claus.reinke at talk21.com
Tue Sep 11 11:50:37 EDT 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghci-browse-bang.diff
Type: application/octet-stream
Size: 9177 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20070911/f3785a3e/ghci-browse-bang.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghci-browse-bang-testsuite.diff
Type: application/octet-stream
Size: 177 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20070911/f3785a3e/ghci-browse-bang-testsuite.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghci022.stdout
Type: application/octet-stream
Size: 2456 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20070911/f3785a3e/ghci022.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghci022.hs
Type: application/octet-stream
Size: 442 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20070911/f3785a3e/ghci022-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghci022.script
Type: application/octet-stream
Size: 97 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20070911/f3785a3e/ghci022-0002.obj
More information about the Cvs-ghc
mailing list