packages feed

bytestring 0.9.1.5 → 0.9.1.6

raw patch · 4 files changed

+12/−16 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Data/ByteString.hs view
@@ -1911,8 +1911,12 @@ -- is far more efficient than reading the characters into a 'String' -- and then using 'pack'. First argument is the Handle to read from,  -- and the second is the number of bytes to read. It returns the bytes--- read, up to n, or EOF.+-- read, up to n, or 'null' if EOF has been reached. --+-- If there is any data to read, then 'hGet' will not block, instead+-- it will return whatever data is available without blocking.  It+-- only blocks if there is no data available to read.+-- -- 'hGet' is implemented in terms of 'hGetBuf'. -- -- If the handle is a pipe or socket, and the writing end@@ -1924,9 +1928,9 @@     | i == 0    = return empty     | otherwise = illegalBufferSize h "hGet" i --- | hGetNonBlocking is identical to 'hGet', except that it will never block--- waiting for data to become available, instead it returns only whatever data--- is available.+-- | hGetNonBlocking is identical to 'hGet', except that it will never+-- block waiting for data to become available.  If there is no data+-- available to be read, 'hGetNonBlocking' returns 'null'. -- hGetNonBlocking :: Handle -> Int -> IO ByteString #if defined(__GLASGOW_HASKELL__)
Data/ByteString/Internal.hs view
@@ -175,7 +175,6 @@         go p 0 acc = peek p          >>= \e -> return (k e : acc)         go p n acc = peekByteOff p n >>= \e -> go p (n-1) (k e : acc) {-# INLINE unpackWith #-}-{-# SPECIALIZE unpackWith :: (Word8 -> Char) -> ByteString -> [Char] #-}  -- | /O(n)/ Convert a '[a]' into a 'ByteString' using some -- conversion function@@ -186,7 +185,6 @@         go _ []     = return ()         go p (x:xs) = poke p (k x) >> go (p `plusPtr` 1) xs -- less space than pokeElemOff {-# INLINE packWith #-}-{-# SPECIALIZE packWith :: (Char -> Word8) -> [Char] -> ByteString #-}  ------------------------------------------------------------------------ 
Data/ByteString/Lazy.hs view
@@ -213,7 +213,7 @@ import Data.Word                (Word8) import Data.Int                 (Int64) import System.IO                (Handle,stdin,stdout,openBinaryFile,IOMode(..)-                                ,hClose,hWaitForInput,hIsEOF)+                                ,hClose) import System.IO.Error          (mkIOError, illegalOperationErrorType) import System.IO.Unsafe #ifndef __NHC__@@ -1174,15 +1174,9 @@     lazyRead = unsafeInterleaveIO loop      loop = do-        c <- S.hGetNonBlocking h k-        --TODO: I think this should distinguish EOF from no data available-        -- the underlying POSIX call makes this distincion, returning either-        -- 0 or EAGAIN+        c <- S.hGet h k -- only blocks if there is no data available         if S.null c-          then do eof <- hIsEOF h-                  if eof then hClose h >> return Empty-                         else hWaitForInput h (-1)-                           >> loop+          then hClose h >> return Empty           else do cs <- lazyRead                   return (Chunk c cs) 
bytestring.cabal view
@@ -1,5 +1,5 @@ Name:                bytestring-Version:             0.9.1.5+Version:             0.9.1.6 Synopsis:            Fast, packed, strict and lazy byte arrays with a list interface Description:     A time and space-efficient implementation of byte vectors using