Haskell 98: Behaviour of hClose

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 18 Sep 2002 16:18:51 +0100


"Simon Peyton-Jones" <simonpj@microsoft.com> writes:

> What I intended was
> 	a simple interactive Haskell program should behave the same 
> 	on any OS/environment
> 
> What you and Ross seem to be saying is
> 	no, the behaviour of the program can, and should, depend 
> 	on the OS/environment
> 
> If that's the consensus I'll happily leave echoing behaviour
> unspecified. Remember, that means that a conforming implementation can
> do whatever it pleases, and hence it's impossible to write a portable
> interactive Haskell program.  Is that you what you intend?

How about amending your proposed insertion to say:

	If the standard input (stdin) is a terminal device, 
	any input on stdin is normally echoed on that device,
	unless the OS/environment settings indicate otherwise.

In other words, echoing is the natural expectation, but any
external controlling influence (terminal device, terminal driver,
OS, environment) should take precedence, since (a) it is explicit
control by the user, and (b) there is no way to achieve the same
control internal to a Haskell'98 program.

Regards,
    Malcolm