Opened 10 years ago

Closed 10 years ago

Last modified 45 years ago

#294 closed bug (Fixed)

GHCi does not find instances

Reported by: nobody Owned by: nobody
Priority: normal Milestone:
Component: Compiler Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

This report concerns GHC HEAD (6.3) as downloaded from
CVS around 2PM on 20 Jan 2005.

It seems GHCi does not find some instance declarations.

Consider the following trivial example:

module Foo where
 
data Foo = Foo
 
instance Show Foo where
    show Foo = "Foo"

When loaded into GHCi, regardless of whether it is
first compiled or not, GHCi claims that Foo is not an
instance
of Show. E.g.

Prelude> :load Foo
Compiling Foo              ( Foo.hs, interpreted )
Ok, modules loaded: Foo.
*Foo> show Foo
 
<interactive>:1:0:
    No instance for (Show Foo)
      arising from use of `show' at <interactive>:1:0-3
    Probable fix: add an instance declaration for (Show
Foo)
    In the definition of `it': it = show Foo
*Foo> :i Foo
data Foo = Foo
-- Defined at Foo.hs:3:5

But Foo is plainly an instance of Show.

GHC itself has no problems with this
(of course).

Best,

/Henrik

e-mail: [email protected]

Change History (1)

comment:1 Changed 10 years ago by simonpj

  • Status changed from assigned to closed
Logged In: YES 
user_id=50165

Fixed, thank you
Note: See TracTickets for help on using tickets.