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

Simon Marlow marlowsd at gmail.com
Mon Aug 23 07:51:38 EDT 2010


On 23/08/2010 12:38, Felipe Lessa wrote:
> On Mon, Aug 23, 2010 at 8:29 AM, Simon Marlow<marlowsd at gmail.com>  wrote:
>> Which documentation are you referring to?  This looks ok to me:
>>
>> http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-IO.html#v%3AhGetBuf
>
> Indeed, while there isn't a big fat warning, it does say that it reads
> 'count' bytes.
>
> However, both RawIO.read and BufferedIO.fillReadBuffer are a bit
> misleading.  The former says that it doesn't block when there isn't
> data available, the latter doesn't say anything.
>
> http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/src/GHC-IO-Device.html#RawIO
> http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/src/GHC-IO-BufferedIO.html#BufferedIO

Hmm, RawIO.read looks ok:

-- | Read up to the specified number of bytes, returning the number
-- of bytes actually read.  This function should only block if there
-- is no data available.  If there is not enough data available,
-- then the function should just return the available data. A return
-- value of zero indicates that the end of the data stream (e.g. end
-- of file) has been reached.

that seems pretty clear to me.  No?

I'll expand the documentation for fillReadBuffer.

Cheers,
	Simon



More information about the Haskell-Cafe mailing list