[Haskell-cafe] GHC + interactive input/output

Ryan Ingram ryani.spam at gmail.com
Fri Feb 8 21:34:37 EST 2008


import System.IO

myGetLine = hFlush stdout >> getLine

  -- ryan

On 2/8/08, Jonathan Cast <jonathanccast at fastmail.fm> wrote:
> On 8 Feb 2008, at 5:29 PM, Philip Weaver wrote:
>
> > GHC certain *could* do this, but it's arguably not the right thing
> > to do.  For performance, the operating system buffers writes until
> > it is ready to write large chunks at a time.  If you do not want
> > this behavior, change the buffering mode from its default.
>
> To what?
>
> BlockBuffering is worse, not better, and the docs *explicitly* say
> that switching to NoBuffering will break ^D (if it wasn't broken
> already...)  My specification for a working program is `one that
> works exactly like every other program on my machine'.  I don't see
> how to produce such a program with GHC.(1)
>
> jcc
>
> (1) Using readline might work (although I'm kind of sceptical given
> what's preceded it), but I haven't gotten it to link thus far...
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list