Opened 9 years ago

Closed 9 years ago

#887 closed bug (fixed)

GHCi prints results of IO actions

Reported by: guest Owned by:
Priority: normal Milestone:
Component: GHCi Version: 6.5
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Apparently, ghci has changed its behaviour from 6.4 to print the result of IO actions, even if assinged to a variable. I often do something like

ghci> x <- myParser "largeFile"

in order to do various tests on x. Having the contents of x dumped to the monitor is annoying, and defeats laziness testing completely.


Change History (3)

comment:1 Changed 9 years ago by simonpj

We changed it because a lot of the time it's very convenenient to see the result of an action. But you have a good point.

(As an unsatisfactory workaround, you could wrap x an un-Showable constructor, or in a function; but that changes its type.)

What do others think? Return to old behaviour? Have another settable option? Or what?


comment:2 Changed 9 years ago by duncan

Would it be possible to distinguish based on the syntax?

content <- getContents

would not print anything, but


would print. That seems reasonably intuitive to me.

comment:3 Changed 9 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed

Done; to disable the printing behaviour for bindings, use

:set -fno-print-bind-result

in GHCi (or -fno-print-bind-result on the command line).

Note: See TracTickets for help on using tickets.