System.Posix.IO.ByteString fdRead and fdWrite.

Herbert Valerio Riedel hvr at gnu.org
Thu Nov 21 08:18:10 UTC 2013


On 2013-11-21 at 00:03:46 +0100, Ashley Yakeley wrote:
> In unix-2.7.0.0, fdRead and fdWrite in System.Posix.IO.ByteString use
> String instead of ByteString. This is wrong, isn't it? The point of
> the .ByteString modules is to do IO in ByteString.

Fwiw, here's the commit introducing the ByteString API and stating its intention:

  http://git.haskell.org/packages/unix.git/commitdiff/34c7bf896f19b182cf6fa104e057f1df9df1254a

However, I'm not totally sure from that, whether the type-sigs


 fdRead :: Fd
        -> ByteCount -- ^How many bytes to read
        -> IO (String, ByteCount) -- ^ The bytes read, how many bytes were read.

 fdWrite :: Fd -> String -> IO ByteCount


were really intended to be that way. 

Simon, maybe you can provide some insight here?


Cheers,
  hvr


More information about the Libraries mailing list