[Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: enumerator, an alternative iteratee package

Felipe Lessa felipe.lessa at gmail.com
Mon Aug 23 07:10:10 EDT 2010


Hello, Simon!

On Mon, Aug 23, 2010 at 8:00 AM, Simon Marlow <marlowsd at gmail.com> wrote:
> The issue is that hGet always waits for a complete buffer-full of data
> before returning.  The hWaitForInput/hGetNonBlocking combination fixes that
> problem, but you have to be careful to make sure that the Handle is in
> binary mode, otherwise hWaitForInput will not behave the way you expect (it
> will decode the input byte stream, and wait for a full character).  For more
> information, see
>
> http://hackage.haskell.org/trac/ghc/ticket/3808
>
> A better fix is to use hGetBufSome, but (a) it is only available in GHC 6.14
> which isn't released yet, and (b) there isn't a bytestring wrapper for it
> yet.

So there really is a problem in the documentation of hGetBuf.  I
assume it got fixed in HEAD together with hGetBufSome.

Cheers! =)

-- 
Felipe.


More information about the Haskell-Cafe mailing list