streamly-0.10.1: Streaming, dataflow programming and declarative concurrency
Copyright(c) 2017 Composewell Technologies
LicenseBSD3
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Data.Stream.Zip

Contents

Description

Deprecated: Use Streamly.Data.Stream.MkType instead.

To run examples in this module:

>>> import qualified Streamly.Prelude as Stream
>>> import qualified Streamly.Internal.Data.Stream as D
>>> import qualified Streamly.Data.Fold as Fold
Synopsis

Documentation

newtype ZipSerialM m a Source #

For ZipSerialM streams:

(<>) = serial
(*) = 'Streamly.Prelude.serial.zipWith' id

Applicative evaluates the streams being zipped serially:

>>> s1 = Stream.fromFoldable [1, 2]
>>> s2 = Stream.fromFoldable [3, 4]
>>> s3 = Stream.fromFoldable [5, 6]
>>> Stream.toList $ Stream.fromZipSerial $ (,,) <$> s1 <*> s2 <*> s3
[(1,3,5),(2,4,6)]

Since: 0.2.0 (Streamly)

Since: 0.8.0

Constructors

ZipSerialM 

Fields

Instances

Instances details
IsStream ZipSerialM Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.IsStream.Type

Methods

toStream :: forall (m :: Type -> Type) a. ZipSerialM m a -> StreamK m a

fromStream :: forall (m :: Type -> Type) a. StreamK m a -> ZipSerialM m a

consM :: MonadAsync m => m a -> ZipSerialM m a -> ZipSerialM m a Source #

(|:) :: MonadAsync m => m a -> ZipSerialM m a -> ZipSerialM m a Source #

(Foldable m, Monad m) => Foldable (ZipSerialM m) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

fold :: Monoid m0 => ZipSerialM m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> ZipSerialM m a -> m0 Source #

foldMap' :: Monoid m0 => (a -> m0) -> ZipSerialM m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> ZipSerialM m a -> b Source #

foldr' :: (a -> b -> b) -> b -> ZipSerialM m a -> b Source #

foldl :: (b -> a -> b) -> b -> ZipSerialM m a -> b Source #

foldl' :: (b -> a -> b) -> b -> ZipSerialM m a -> b Source #

foldr1 :: (a -> a -> a) -> ZipSerialM m a -> a Source #

foldl1 :: (a -> a -> a) -> ZipSerialM m a -> a Source #

toList :: ZipSerialM m a -> [a] Source #

null :: ZipSerialM m a -> Bool Source #

length :: ZipSerialM m a -> Int Source #

elem :: Eq a => a -> ZipSerialM m a -> Bool Source #

maximum :: Ord a => ZipSerialM m a -> a Source #

minimum :: Ord a => ZipSerialM m a -> a Source #

sum :: Num a => ZipSerialM m a -> a Source #

product :: Num a => ZipSerialM m a -> a Source #

Traversable (ZipSerialM Identity) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Monad m => Applicative (ZipSerialM m) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

pure :: a -> ZipSerialM m a Source #

(<*>) :: ZipSerialM m (a -> b) -> ZipSerialM m a -> ZipSerialM m b Source #

liftA2 :: (a -> b -> c) -> ZipSerialM m a -> ZipSerialM m b -> ZipSerialM m c Source #

(*>) :: ZipSerialM m a -> ZipSerialM m b -> ZipSerialM m b Source #

(<*) :: ZipSerialM m a -> ZipSerialM m b -> ZipSerialM m a Source #

Monad m => Functor (ZipSerialM m) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

fmap :: (a -> b) -> ZipSerialM m a -> ZipSerialM m b Source #

(<$) :: a -> ZipSerialM m b -> ZipSerialM m a Source #

NFData1 (ZipSerialM Identity) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

liftRnf :: (a -> ()) -> ZipSerialM Identity a -> () Source #

a ~ Char => IsString (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Monoid (ZipSerialM m a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Semigroup (ZipSerialM m a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

(<>) :: ZipSerialM m a -> ZipSerialM m a -> ZipSerialM m a Source #

sconcat :: NonEmpty (ZipSerialM m a) -> ZipSerialM m a Source #

stimes :: Integral b => b -> ZipSerialM m a -> ZipSerialM m a Source #

IsList (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Associated Types

type Item (ZipSerialM Identity a) Source #

Read a => Read (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Show a => Show (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

NFData a => NFData (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

rnf :: ZipSerialM Identity a -> () Source #

Eq a => Eq (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Ord a => Ord (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

type Item (ZipSerialM Identity a) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

type Item (ZipSerialM Identity a) = a

type ZipSerial = ZipSerialM IO Source #

An IO stream whose applicative instance zips streams serially.

Since: 0.2.0 (Streamly)

Since: 0.8.0

consMZip :: Monad m => m a -> ZipSerialM m a -> ZipSerialM m a Source #

zipWithK :: Monad m => (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c Source #

zipWithMK :: Monad m => (a -> b -> m c) -> Stream m a -> Stream m b -> Stream m c Source #

newtype ZipConcurrent m a Source #

Constructors

ZipConcurrent 

Fields

Instances

Instances details
MonadAsync m => Applicative (ZipConcurrent m) Source #

An IO stream whose applicative instance zips streams concurrently. Note that it uses the default concurrency options.

>>> s = ZipConcurrent $ D.fromList [1, 2, 3]
>>> x = (,,) <$> s <*> s <*> s
>>> D.fold Fold.toList (getZipConcurrent x)
[(1,1,1),(2,2,2),(3,3,3)]

Since: 0.9.0

Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Monad m => Functor (ZipConcurrent m) Source # 
Instance details

Defined in Streamly.Internal.Data.Stream.Zip

Methods

fmap :: (a -> b) -> ZipConcurrent m a -> ZipConcurrent m b Source #

(<$) :: a -> ZipConcurrent m b -> ZipConcurrent m a Source #

Deprecated

type ZipStream = ZipSerialM Source #

Since: 0.1.0