[Haskell-cafe] Re: Emulating bash pipe/ process lib

Simon Marlow simonmarhaskell at gmail.com
Tue Feb 21 08:05:57 EST 2006


Bulat Ziganshin wrote:

> Friday, February 10, 2006, 2:53:25 PM, you wrote:
> 
> i'm not very interested to do something fascinating in this area. it
> seems that it is enough to do
> 
> 1) non-blocking read of the entire buffer on input
> 2) flush buffer at each '\n' at output
> 
> that should be enough to implement LineBuffering for everyone except
> purists? and for the NoBuffering the same except for flushing after
> each output operation?

Yes, exactly.  This is almost what GHC's System.IO currently does, 
except that for NoBuffering we have a fixed buffer size of 1 byte.  It 
would be safe to have a larger buffer size for NoBuffering read handles, 
but I didn't recognise that when I wrote it.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list