Skip to content

Unhelpful error message in GHCi

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

Trac metadata
Trac field Value
Version 6.12.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information