Opened 9 years ago

Closed 9 years ago

Last modified 44 years ago

#316 closed bug (Fixed)

GHCi: No instance for (Show (IO ()))

Reported by: simonmar Owned by: nobody
Priority: low Milestone:
Component: GHCi Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

From Wolfgang Thaller:

This behaviour (from today's stable branch) is slightly
confusing:

> Prelude> print id
>
> Top level:
>     No instance for (Show (IO ()))
>       arising from use of `print' at Top level
>     Probable fix: add an instance declaration for
(Show (IO ()))
>     In a 'do' expression: print it
>
> <interactive>:1:0:
>     No instance for (Show (a -> a))
>       arising from use of `print' at <interactive>:1:0-4
>     Probable fix: add an instance declaration for
(Show (a -> a))
>     In the definition of `it': it = print id

The second message makes sense, but the first one
doesn't. Also, what's 
the difference between "Top level" and "<interactive>:1:0"?


Change History (3)

comment:1 Changed 9 years ago by simonmar

Logged In: YES 
user_id=48280

Futher to this bug report, here's another expression that
gives a terrible error message:

Prelude Random> randomRIO (1,2)

Top level:
    No instance for (Show (IO a))
      arising from use of `print' at Top level
    Probable fix: add an instance declaration for (Show (IO a))
    In a 'do' expression: print it

comment:2 Changed 9 years ago by simonpj

Logged In: YES 
user_id=50165

Finally fixed.

comment:3 Changed 9 years ago by simonpj

  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.