Regardless of what the report says (I can see why Hugs choose to
deviate), the problem here is really that there's presently no way for
the Haskell programmer of changing the echoing of a terminal attached
to a Handle. Adding the following two operations to IOExts would help

  setEcho :: Handle -> Bool -> IO ()
  getEcho :: Handle -> IO Bool

In addition, you probably also want support for installing Haskell
signal handlers and/or on-exit handlers to reset the tty. Either that
or some system guarantee that a terminal will be reset upon (ab)normal
program termination.

--Sigbjorn

Alastair Reid writes:
> 
> [Reply redirected to bug mailing lists and copied to the library czar]
> 
> Sigbjorn writes:
> > GHC's behaviour [of Prelude.interact] is consistent with the
> > report, Hugs' isn't.
> 
> Hugs deliberately deviates from the report (ie turns 
> echoing off when running interact) because the report is
> clearly broken.
> 
> The only reason for including "interact" in the Prelude is so
> that you can write:
> 
>    interact (map toUpper)
> 
> and the like.  This is only useful if echoing is turned off - so we do.
> 
> 
> Alastair
> 
> ps The URL Sigbjorn posted should be:
>   
>    http://www.dcs.gla.ac.uk/mail-www/haskell/msg00270.html
> 
> and this doesn't contain a link to all the followups:
> 
>   http://www.dcs.gla.ac.uk/mail-www/haskell/msg00272.html
>   http://www.dcs.gla.ac.uk/mail-www/haskell/msg00273.html
>   http://www.dcs.gla.ac.uk/mail-www/haskell/msg00277.html
> 
> (Sigbjorn: any chance of adding a "possible followups" 
>  list as well as the "followups" list?)
> 

Reply via email to