conduit-extra 1.1.7.3 → 1.1.8
raw patch · 3 files changed
+24/−5 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Data.Conduit.Binary: sourceHandleRangeWithBuffer :: MonadIO m => Handle -> Maybe Integer -> Maybe Integer -> Int -> Producer m ByteString
- Data.Conduit.Network.UDP: Message :: UnpkByteString -> SrictNotUnpackedSockAddr -> Message
+ Data.Conduit.Network.UDP: Message :: SrictNotUnpackedByteString -> SrictNotUnpackedSockAddr -> Message
- Data.Conduit.Network.UDP: msgData :: Message -> UnpkByteString
+ Data.Conduit.Network.UDP: msgData :: Message -> SrictNotUnpackedByteString
Files
- ChangeLog.md +4/−0
- Data/Conduit/Binary.hs +18/−3
- conduit-extra.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.1.8++* Adding buffer size to sourceHandleRange [#213](https://github.com/snoyberg/conduit/pull/213)+ ## 1.1.7.3 * Make Binary.lines O(n) instead of O(n^2) [#209](https://github.com/snoyberg/conduit/pull/209)
Data/Conduit/Binary.hs view
@@ -17,6 +17,7 @@ , sourceIOHandle , sourceFileRange , sourceHandleRange+ , sourceHandleRangeWithBuffer -- ** Sinks , sinkFile , sinkHandle@@ -181,7 +182,21 @@ -> Maybe Integer -- ^ Offset -> Maybe Integer -- ^ Maximum count -> Producer m S.ByteString-sourceHandleRange handle offset count = do+sourceHandleRange handle offset count =+ sourceHandleRangeWithBuffer handle offset count defaultChunkSize++-- | Stream the contents of a handle as binary data, starting from a certain+-- offset and only consuming up to a certain number of bytes. This function+-- consumes chunks as specified by the buffer size.+--+-- Since 1.1.8+sourceHandleRangeWithBuffer :: MonadIO m+ => IO.Handle+ -> Maybe Integer -- ^ Offset+ -> Maybe Integer -- ^ Maximum count+ -> Int -- ^ Buffer size+ -> Producer m S.ByteString+sourceHandleRangeWithBuffer handle offset count buffer = do case offset of Nothing -> return () Just off -> liftIO $ IO.hSeek handle IO.AbsoluteSeek off@@ -190,7 +205,7 @@ Just c -> pullLimited (fromInteger c) where pullUnlimited = do- bs <- liftIO $ S.hGetSome handle 4096+ bs <- liftIO $ S.hGetSome handle buffer if S.null bs then return () else do@@ -198,7 +213,7 @@ pullUnlimited pullLimited c = do- bs <- liftIO $ S.hGetSome handle (min c 4096)+ bs <- liftIO $ S.hGetSome handle (min c buffer) let c' = c - S.length bs assert (c' >= 0) $ if S.null bs
conduit-extra.cabal view
@@ -1,5 +1,5 @@ Name: conduit-extra-Version: 1.1.7.3+Version: 1.1.8 Synopsis: Batteries included conduit: adapters for common libraries. Description: The conduit package itself maintains relative small dependencies. The purpose of this package is to collect commonly used utility functions wrapping other library dependencies, without depending on heavier-weight dependencies. The basic idea is that this package should only depend on haskell-platform packages and conduit.@@ -32,7 +32,7 @@ if !os(windows) Exposed-modules: Data.Conduit.Network.Unix - Build-depends: base >= 4 && < 5+ Build-depends: base >= 4.5 && < 5 , conduit >= 1.1 && < 1.3 -- No version bounds necessary, since they're inherited