Opened 10 years ago

Closed 10 years ago

Last modified 46 years ago

#429 closed bug (Duplicate)

when typing expression fails, don't try to Show it

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

Description

Enter a ghci session, and run "print id":

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

It would be nice to make the first error go away.  It
looks as if, when typing "print id" fails, ghci
nonetheless goes ahead and tries to type "let it =
print id; print it", or something.  This just creates
useless noise.

Change History (2)

comment:1 Changed 10 years ago by simonmar

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

duplicate of #1156554, and already fixed in the HEAD:

Prelude> print id

<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

though this fix won't be in 6.4.1 (it makes some other
changes to the way GHCi interaction works, so I'm being
conservative here).

comment:2 Changed 10 years ago by pimlott

Logged In: YES 
user_id=498741

Great. (I realize I was only searching open bugs, so I
didn't see the existing report.)
Note: See TracTickets for help on using tickets.