Ticket #4017 (new bug)

Opened 3 years ago

Last modified 9 months ago

Unhelpful error message in GHCi

Reported by: simonpj Owned by:
Priority: lowest Milestone: 7.6.2
Component: Compiler Version: 6.12.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

Change History

Changed 3 years ago by igloo

  • milestone set to 6.12.3

Changed 3 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 3 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 21 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 16 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1

Changed 9 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.