[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
Wed Apr 11 20:24:14 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            |      Component:  GHCi            
  Version:  7.4.1             |       Keywords:  ghci :info      
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 Haskell report 5.4 says that instance visibility is transitively kept
 amongst module imports.

 So, if A imports B, B imports C, and inside C.hs I have instance Eq C, it
 is enough to import A in Main.hs to have the Eq C instance visible.  It is
 not required to import C directly.

 When I use the import chain, the compiler works correctly, but ghci :info
 Eq doesn't report C as an instance, only if I import C directly.

 This behavior is misleading, because if someone is not familiar with the
 specification, may believe after trying with :info that the instance is
 not transitively visible.

 I attached a test for this issue, after unpacking you can use demo.sh to
 demonstrate the issue.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5998>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list