packages feed

conduit 0.5.2.3 → 0.5.2.4

raw patch · 6 files changed

+32/−4 lines, 6 filesdep ~basedep ~resourcetPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

Dependency ranges changed: base, resourcet

API changes (from Hackage documentation)

+ Data.Conduit.List: foldMap :: (Monad m, Monoid b) => (a -> b) -> GSink a m b

Files

Data/Conduit/Binary.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP, RankNTypes #-} -- | Functions for interacting with bytes. module Data.Conduit.Binary     ( -- * Files and @Handle@s
Data/Conduit/Internal.hs view
@@ -429,6 +429,12 @@  -- | Transform the monad that a @Pipe@ lives in. --+-- Note that the monad transforming function will be run multiple times,+-- resulting in unintuitive behavior in some cases. For a fuller treatment,+-- please see:+--+-- <https://github.com/snoyberg/conduit/wiki/Dealing-with-monad-transformers>+-- -- Since 0.4.0 transPipe :: Monad m => (forall a. m a -> n a) -> Pipe l i o u m r -> Pipe l i o u n r transPipe f (HaveOutput p c o) = HaveOutput (transPipe f p) (f c) o
Data/Conduit/List.hs view
@@ -18,6 +18,7 @@       -- * Sinks       -- ** Pure     , fold+    , foldMap     , take     , drop     , head@@ -59,6 +60,7 @@     , maybe     , either     )+import Data.Monoid (Monoid, mempty, mappend) import Data.Conduit hiding (Source, Sink, Conduit, Pipe) import Data.Conduit.Internal (sourceList) import Control.Monad (when, (<=<))@@ -137,6 +139,17 @@         go a = do             accum' <- lift $ f accum a             accum' `seq` loop accum'++-- | A monoidal strict left fold.+--+-- Since 0.5.3+foldMap :: (Monad m, Monoid b)+        => (a -> b)+        -> GSink a m b+foldMap f =+    fold combiner mempty+  where+    combiner accum = mappend accum . f  -- | Apply the action to all values in the stream. --
Data/Conduit/Text.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveDataTypeable, RankNTypes #-} -- | -- Copyright: 2011 Michael Snoyman, 2010-2011 John Millikin -- License: MIT
conduit.cabal view
@@ -1,5 +1,5 @@ Name:                conduit-Version:             0.5.2.3+Version:             0.5.2.4 Synopsis:            Streaming data processing library. Description:     @conduit@ is a solution to the streaming data problem, allowing for production, transformation, and consumption of streams of data in constant memory. It is an alternative to lazy I\/O which guarantees deterministic resource handling, and fits in the same general solution space as @enumerator@/@iteratee@ and @pipes@. For a brief tutorial, please see the "Data.Conduit" module.@@ -52,7 +52,7 @@                        Data.Conduit.Util.Sink                        Data.Conduit.Util.Conduit   Build-depends:       base                     >= 4.3          && < 5-                     , resourcet                >= 0.3          && < 0.4+                     , resourcet                >= 0.3          && < 0.5                      , lifted-base              >= 0.1          && < 0.2                      , transformers-base        >= 0.4.1        && < 0.5                      , monad-control            >= 0.3.1        && < 0.4
test/main.hs view
@@ -90,6 +90,15 @@             (runST $ CL.sourceList list C.$$ CL.fold (+) (0 :: Int))             == sum list +    describe "foldMap" $ do+        it "sums 1..10" $ do+            Sum x <- CL.sourceList [1..(10 :: Int)] C.$$ CL.foldMap Sum+            x `shouldBe` sum [1..10]++        it "preserves order" $ do+            x <- CL.sourceList [[4],[2],[3],[1]] C.$$ CL.foldMap (++[(9 :: Int)])+            x `shouldBe` [4,9,2,9,3,9,1,9]+     describe "unfold" $ do         it "works" $ do             let f 0 = Nothing