
On 21/11/13 08:18, Herbert Valerio Riedel wrote:
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/34c7bf896f19b182cf6fa104...
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?
Brandon's reply is correct, the ByteString variant of the POSIX API is intended to change the representation of file paths only. These two functions are totally useless and we need better versions anyway. Cheers, Simon