[ ghc-Bugs-1247773 ] when typing expression fails, don't try to Show it

SourceForge.net noreply at sourceforge.net
Mon Aug 1 13:36:39 EDT 2005


Bugs item #1247773, was opened at 2005-07-29 19:15
Message generated for change (Comment added) made by pimlott
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1247773&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: GHCi
Group: None
Status: Closed
Resolution: Duplicate
Priority: 5
Submitted By: Andrew Pimlott (pimlott)
Assigned to: Nobody/Anonymous (nobody)
Summary: when typing expression fails, don't try to Show it

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Andrew Pimlott (pimlott)
Date: 2005-08-01 12:36

Message:
Logged In: YES 
user_id=498741

Great. (I realize I was only searching open bugs, so I
didn't see the existing report.)

----------------------------------------------------------------------

Comment By: Simon Marlow (simonmar)
Date: 2005-08-01 08:12

Message:
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).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1247773&group_id=8032



More information about the Glasgow-haskell-bugs mailing list