[GHC] #5998: GHCi's :info to return all the visible instances, not just the ones imported from currently loaded files
GHC
cvs-ghc at haskell.org
Fri Apr 13 11:22:21 CEST 2012
#5998: GHCi's :info to return all the visible instances, not just the ones
imported from currently loaded files
---------------------------------+------------------------------------------
Reporter: errge | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.4.1
Keywords: ghci :info | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Changes (by simonpj):
* difficulty: => Unknown
Comment:
Currently this is by design: GHC only displays instances whose types have
been brought into scope. In this case module B does not export the type
C, so C is not in scope in Main, so its instances are not displayed.
This is a design choice (implemented in the `plausible` function in
`InteractiveEval.getInfo`). I'm not sure when we introduced it, or how
persuasive the reasoning was at the time. Changing it to display all
instances would be easy; but then you might get `Eq` instantces displayed
for zillions of types that you had no interest in.
One could make other choices: eg display only for types in the current
package, not for imported packages... I don't know what's best. Opinions
anyone?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5998#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list