packages feed

conduit-combinators 1.0.5 → 1.0.6

raw patch · 5 files changed

+32/−1 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Conduit: peekForeverE :: (Monad m, MonoFoldable i) => ConduitM i o m () -> ConduitM i o m ()
+ Data.Conduit.Combinators: peekForeverE :: (Monad m, MonoFoldable i) => ConduitM i o m () -> ConduitM i o m ()
- Conduit: lift :: (MonadTrans t, Monad m) => m a -> t m a
+ Conduit: lift :: Monad m => m a -> t m a
- Conduit: liftBase :: MonadBase b m => b α -> m α
+ Conduit: liftBase :: b α -> m α
- Conduit: liftIO :: MonadIO m => IO a -> m a
+ Conduit: liftIO :: IO a -> m a
- Conduit: throwM :: (MonadThrow m, Exception e) => e -> m a
+ Conduit: throwM :: Exception e => e -> m a

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+# 1.0.6++* Add `peekForeverE` combinator+ # 1.0.5  * Add head, headDef and lastDef combinators
Data/Conduit/Combinators.hs view
@@ -190,6 +190,7 @@     , vectorBuilder     , mapAccumS     , peekForever+    , peekForeverE     ) where  -- BEGIN IMPORTS@@ -2148,6 +2149,27 @@   where     loop = do         mx <- peek+        case mx of+            Nothing -> return ()+            Just _ -> inner >> loop++-- | Run a consuming conduit repeatedly, only stopping when there is no more+-- data available from upstream.+--+-- In contrast to 'peekForever', this function will ignore empty+-- chunks of data. So for example, if a stream of data contains an+-- empty @ByteString@, it is still treated as empty, and the consuming+-- function is not called.+--+-- @since 1.0.6+peekForeverE :: (Monad m, MonoFoldable i)+             => ConduitM i o m ()+             -> ConduitM i o m ()+peekForeverE inner =+    loop+  where+    loop = do+        mx <- peekE         case mx of             Nothing -> return ()             Just _ -> inner >> loop
Data/Conduit/Combinators/Unqualified.hs view
@@ -174,6 +174,7 @@     , vectorBuilderC     , CC.mapAccumS     , CC.peekForever+    , CC.peekForeverE     ) where  -- BEGIN IMPORTS
conduit-combinators.cabal view
@@ -1,5 +1,5 @@ name:                conduit-combinators-version:             1.0.5+version:             1.0.6 synopsis:            Commonly used conduit functions, for both chunked and unchunked data description:         Provides a replacement for Data.Conduit.List, as well as a convenient Conduit module. homepage:            https://github.com/snoyberg/mono-traversable
test/Spec.hs view
@@ -668,6 +668,10 @@         res1 <- yieldMany strs $$ linesUnboundedC =$ sinkList         res2 <- yieldMany strs $$ peekForever (lineC $ foldC >>= yield) =$ sinkList         res2 `shouldBe` res1+    prop "peekForeverE" $ \(strs :: [String]) -> do+        res1 <- yieldMany strs $$ linesUnboundedC =$ sinkList+        res2 <- yieldMany strs $$ peekForeverE (lineC $ foldC >>= yield) =$ sinkList+        res2 `shouldBe` res1     StreamSpec.spec  evenInt :: Int -> Bool