packages feed

io-streams 1.4.1.0 → 1.5.0.0

raw patch · 4 files changed

+19/−20 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog.md view
@@ -1,3 +1,8 @@+# Version 1.5.0.0+- Changed the behaviour of `ByteString.splitOn` to not emit empty string if the+  input ends in the delimiter; now `lines` should match Prelude's. Bumped major+  version because this is a potentially breaking change (even if it is a bugfix.)+ # Version 1.4.1.0  - Added `writeTo` export to the main module (forgotten when it was added to
io-streams.cabal view
@@ -1,5 +1,5 @@ Name:                io-streams-Version:             1.4.1.0+Version:             1.5.0.0 License:             BSD3 License-file:        LICENSE Category:            Data, Network, IO-Streams
src/System/IO/Streams/ByteString.hs view
@@ -61,7 +61,7 @@ import           Data.IORef                        (IORef, newIORef, readIORef, writeIORef) import           Data.Time.Clock.POSIX             (getPOSIXTime) import           Data.Typeable                     (Typeable)-import           Prelude                           hiding (read, lines, unlines, words, unwords)+import           Prelude                           hiding (lines, read, unlines, unwords, words) ------------------------------------------------------------------------------ import           System.IO.Streams.Combinators     (filterM, intersperse, outputFoldM) import           System.IO.Streams.Internal        (InputStream (..), OutputStream, makeInputStream, makeOutputStream, read, unRead, write)@@ -272,6 +272,10 @@ -- --   * consecutive delimiters are not merged. --+--   * if the input ends in the delimiter, a final empty string is /not/+--     emitted. (/Since: 1.5.0.0. Previous versions had the opposite behaviour,+--     which was changed to match 'Prelude.lines'./)+-- -- Example: -- -- @@@ -305,15 +309,9 @@                        else do                          let !b' = S.unsafeDrop 1 b                          dl <- readIORef ref--                         if S.null b'-                           then do-                             writeIORef ref ("" :)-                             return $ Just $! S.concat $ dl [a]-                           else do-                             writeIORef ref id-                             unRead b' is-                             return $ Just $! S.concat $ dl [a]+                         when (not $ S.null b') $ unRead b' is+                         writeIORef ref id+                         return $ Just $! S.concat $ dl [a]   ------------------------------------------------------------------------------
test/System/IO/Streams/Tests/ByteString.hs view
@@ -8,18 +8,12 @@ import           Data.ByteString.Char8                (ByteString) import qualified Data.ByteString.Char8                as S import qualified Data.ByteString.Lazy.Char8           as L-import           Data.List                            hiding (lines,-                                                       takeWhile, unlines,-                                                       unwords, words)+import           Data.List                            hiding (lines, takeWhile, unlines, unwords, words) import           Data.Maybe                           (isJust) import           Data.Monoid-import           Prelude                              hiding (lines, read,-                                                       take, takeWhile,-                                                       unlines, unwords,-                                                       words)+import           Prelude                              hiding (lines, read, take, takeWhile, unlines, unwords, words) import qualified Prelude-import           System.IO.Streams                    hiding (filter,-                                                       intersperse, mapM_)+import           System.IO.Streams                    hiding (filter, intersperse, mapM_) import           System.IO.Streams.Tests.Common import           System.Timeout import           Test.Framework@@ -625,6 +619,8 @@     fromList ["th", "e\nquick\nbrown", "\n", "", "fox"] >>= lines >>=              toList >>= assertEqual "lines" ["the", "quick", "brown", "fox"]     fromList [] >>= lines >>= toList >>= assertEqual "empty lines" []+    fromList ["a\nb\nc\n"] >>= lines >>= toList+       >>= assertEqual "ending in delimiter" ["a","b","c"]      fromList ["ok", "cool"] >>=       \is -> outputToList (\os -> unlines os >>= connect is) >>=