#4017: Unhelpful error message in GHCi
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  6.12.2      
    Keywords:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Testcase:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
       Patch:  0                 |  
---------------------------------+------------------------------------------
 John Launchbury encountered an unhelpful error message in GHCi.  Try this:
 {{{
 *Test> :i GHC.Integer.Type.Integer

 Top level:
     Failed to load interface for `GHC.Integer.Type':
       it is a hidden module in the package `integer-gmp'
       Use -v to see a list of the files searched for.
 *Test>
 }}}
 Two points
  * The "-v" suggestion is no help at at all: a straightforward response is
 to try
 {{{
 *Test> :i -v GHC.Integer.Type.Integer
 }}}
   But that does not work.  Either it should work, or the error message
 should say "Try `:set -v` to see a list..."

  * In any case, since we know it's a hidden module, it'd be more helpful
 to suggest "Possible fix: use `:set -package integer-gmp`.

 It's also confusing that if you instead say:
 {{{
 *Test> :i Integer
 data Integer
   = integer-gmp:GHC.Integer.Type.S# GHC.Prim.Int#
   | integer-gmp:GHC.Integer.Type.J# GHC.Prim.Int# GHC.Prim.ByteArray#
         -- Defined in integer-gmp:GHC.Integer.Type
 instance Enum Integer -- Defined in GHC.Num
 instance Eq Integer -- Defined in GHC.Num
 instance Integral Integer -- Defined in GHC.Real
 instance Num Integer -- Defined in GHC.Num
 instance Ord Integer -- Defined in GHC.Num
 instance Read Integer -- Defined in GHC.Read
 instance Real Integer -- Defined in GHC.Real
 instance Show Integer -- Defined in GHC.Num
 *Test>
 }}}
 you get the info.  So specifying the full name doesn't work (saying it
 can't load an interface) but the unqualified one does (which presumably
 involves loading the interface).  Strange.

 All in 6.12.


 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4017>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to