H98 Report: input functions

Simon Peyton-Jones simonpj@microsoft.com
Mon, 9 Sep 2002 16:23:24 +0100


| In 7.1, the Report says of getChar, getContents and friends:
|=20
| 	"By default, these input functions echo to standard output."
|=20
| This would mean that the example given:
|=20
| 	main =3D interact (filter isAscii)
|=20
| would print the input with all ASCII characters duplicated.
|=20
| Surely it should say that if the standard input is a terminal device
the
| input is echoed on that device.  Or maybe the sentence should be
deleted.

Ross's speaks truth.  In fact, the overall behaviour of a Haskell
program when used from a terminal ought to be predicable regardless of
OS.  And indeed one expects the behaviour to differ depending on whether
stdin is a terminal or a file.

So I propose to adopt Ross's modification: "Surely it should say that if
the standard input is a terminal device the input is echoed on that
device."  This describes what Haskell implementations actually do, and
it describes the desired behaviour.

All this is about the Language Report.  In the Library Report, it says
that "getLine" is sort for "hGetLine stdin".  So that implies that=20

	If the standard input (stdin) is a terminal device,=20
	any input on stdin is echoed on that device

So, for consistency, I propose to add that to the IO chapter of the
library report.

Does that seem right?  It is very late in the day to be fiddling with
the Report. I'll emit an update in a separate message.

Simon