[Haskell-cafe] Re: Network parsing and parsec
Keean Schupke
k.schupke at imperial.ac.uk
Tue Sep 20 10:05:25 EDT 2005
John Goerzen wrote:
>On Tue, Sep 20, 2005 at 02:29:12PM +0100, Keean Schupke wrote:
>
>
>>>It's unclear to me exactly how to mix the IO monad with Parsec. It
>>>doesn't really seem to be doable.
>>>
>>>Not to mention that if hGetContents is used, the Handle has to be put
>>>into non-buffering mode, which means one syscall per character read.
>>>Terribly slow.
>>>
>>>
>>>
>>>
>>>
>>Does it? I didn't think so ...
>>
>>
>
>strace seems to say yes.
>
>
Thats odd, the source code seems to suggest that when you read past the
end of the buffer
it reads the next entire buffer (it has cases for each possible buffer
configuration, line, block and none) - and I can think of no reason
_why_ it cannot use buffering... I would think that it's a bug if it is
the case.
Regards,
Keean.
More information about the Haskell-Cafe
mailing list