conduit 0.5.2.7 → 0.5.3
raw patch · 6 files changed
+38/−6 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Conduit: ExceptionT :: m (Either SomeException a) -> ExceptionT a
+ Data.Conduit: class MonadBase b m => MonadBaseControl (b :: * -> *) (m :: * -> *) | m -> b
+ Data.Conduit: newtype ExceptionT (m :: * -> *) a :: (* -> *) -> * -> *
+ Data.Conduit: runExceptionT :: ExceptionT a -> m (Either SomeException a)
+ Data.Conduit: runExceptionT_ :: Monad m => ExceptionT m a -> m a
Files
- Data/Conduit.hs +3/−0
- Data/Conduit/Internal.hs +3/−3
- Data/Conduit/Lazy.hs +1/−1
- Data/Conduit/List.hs +23/−1
- conduit.cabal +1/−1
- test/main.hs +7/−0
Data/Conduit.hs view
@@ -67,6 +67,9 @@ , MonadThrow (..) , MonadUnsafeIO (..) , runResourceT+ , ExceptionT (..)+ , runExceptionT_+ , MonadBaseControl ) where import Control.Monad.Trans.Resource
Data/Conduit/Internal.hs view
@@ -450,10 +450,10 @@ -- -- http://hpaste.org/75520 collapse mpipe = do- pipe <- mpipe- case pipe of+ pipe' <- mpipe+ case pipe' of PipeM mpipe' -> collapse mpipe'- _ -> return pipe+ _ -> return pipe' transPipe f (Leftover p i) = Leftover (transPipe f p) i -- | Apply a function to all the output values of a @Pipe@.
Data/Conduit/Lazy.hs view
@@ -10,7 +10,7 @@ import Data.Conduit import Data.Conduit.Internal (Pipe (..)) import System.IO.Unsafe (unsafeInterleaveIO)-import Control.Monad.Trans.Control (MonadBaseControl, liftBaseOp_)+import Control.Monad.Trans.Control (liftBaseOp_) import Control.Monad.Trans.Resource (MonadActive (monadActive)) -- | Use lazy I\/O to consume all elements from a @Source@.
Data/Conduit/List.hs view
@@ -62,7 +62,7 @@ ) import Data.Monoid (Monoid, mempty, mappend) import Data.Conduit hiding (Source, Sink, Conduit, Pipe)-import Data.Conduit.Internal (sourceList)+import Data.Conduit.Internal (sourceList, pipeL, pipe) import Control.Monad (when, (<=<)) import Control.Monad.Trans.Class (lift) @@ -213,6 +213,28 @@ -- Since 0.3.0 map :: Monad m => (a -> b) -> GInfConduit a m b map f = awaitForever $ yield . f++{-++It might be nice to include these rewrite rules, but they may have subtle+differences based on leftovers.++{-# RULES "map-to-mapOutput pipeL" forall f src. pipeL src (map f) = mapOutput f src #-}+{-# RULES "map-to-mapOutput $=" forall f src. src $= (map f) = mapOutput f src #-}+{-# RULES "map-to-mapOutput pipe" forall f src. pipe src (map f) = mapOutput f src #-}+{-# RULES "map-to-mapOutput >+>" forall f src. src >+> (map f) = mapOutput f src #-}++{-# RULES "map-to-mapInput pipeL" forall f sink. pipeL (map f) sink = mapInput f (Prelude.const Prelude.Nothing) sink #-}+{-# RULES "map-to-mapInput =$" forall f sink. map f =$ sink = mapInput f (Prelude.const Prelude.Nothing) sink #-}+{-# RULES "map-to-mapInput pipe" forall f sink. pipe (map f) sink = mapInput f (Prelude.const Prelude.Nothing) sink #-}+{-# RULES "map-to-mapInput >+>" forall f sink. map f >+> sink = mapInput f (Prelude.const Prelude.Nothing) sink #-}++{-# RULES "map-to-mapOutput =$=" forall f con. con =$= map f = mapOutput f con #-}+{-# RULES "map-to-mapInput =$=" forall f con. map f =$= con = mapInput f (Prelude.const Prelude.Nothing) con #-}++{-# INLINE [1] map #-}++-} -- | Apply a monadic transformation to all values in a stream. --
conduit.cabal view
@@ -1,5 +1,5 @@ Name: conduit-Version: 0.5.2.7+Version: 0.5.3 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.
test/main.hs view
@@ -197,6 +197,13 @@ C.$$ CL.fold (+) 0 x `shouldBe` 2 * sum [1..10 :: Int] + it "map, left >+>" $ do+ x <- runResourceT $+ CL.sourceList [1..10]+ C.>+> CL.map (* 2)+ C.$$ CL.fold (+) 0+ x `shouldBe` 2 * sum [1..10 :: Int]+ it "map, right" $ do x <- runResourceT $ CL.sourceList [1..10]