conduit-extra 1.1.15 → 1.1.16
raw patch · 3 files changed
+33/−1 lines, 3 filesdep ~exceptionsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: exceptions
API changes (from Hackage documentation)
+ Data.Conduit.Foldl: sinkFold :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Consumer a m b
+ Data.Conduit.Foldl: sinkFoldM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Consumer a m b
Files
- ChangeLog.md +5/−0
- Data/Conduit/Foldl.hs +26/−0
- conduit-extra.cabal +2/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+## 1.1.16++* Add `Data.Conduit.Foldl` adapter module for the `foldl`+ package. [#312](https://github.com/snoyberg/conduit/pull/312)+ ## 1.1.15 * `sinkTempFile` and `sinkSystemTempFile`
+ Data/Conduit/Foldl.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE RankNTypes #-}+-- | Adapter module to work with the <https://hackage.haskell.org/package/foldl foldl> package.+--+-- @since 1.1.16+module Data.Conduit.Foldl where++import Data.Conduit+import Control.Monad.Trans.Class (lift)+import qualified Data.Conduit.List as CL++-- | Convert a left fold into a 'Consumer'. This function is intended+-- to be used with @purely@ from the+-- <https://hackage.haskell.org/package/foldl foldl> package.+--+-- @since 1.1.16+sinkFold :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Consumer a m b+sinkFold combine seed extract = fmap extract (CL.fold combine seed)++-- | Convert a monadic left fold into a 'Consumer'. This function is+-- intended to be used with @impurely@ from the+-- <https://hackage.haskell.org/package/foldl foldl> package.+--+-- @since 1.1.16+sinkFoldM :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Consumer a m b+sinkFoldM combine seed extract =+ lift . extract =<< CL.foldM combine =<< lift seed
conduit-extra.cabal view
@@ -1,5 +1,5 @@ Name: conduit-extra-Version: 1.1.15+Version: 1.1.16 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.@@ -24,6 +24,7 @@ Data.Conduit.Blaze Data.Conduit.ByteString.Builder Data.Conduit.Filesystem+ Data.Conduit.Foldl Data.Conduit.Lazy Data.Conduit.Network Data.Conduit.Network.UDP