streamly-0.8.2: Dataflow programming and declarative concurrency
Copyright(c) 2019 Composewell Technologies
LicenseBSD3
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Streamly.Internal.Data.Pipe.Type

Description

 
Synopsis

Documentation

data Step s a Source #

Constructors

Yield a s 
Continue s 

data Pipe m a b Source #

Constructors

forall s1 s2. Pipe (s1 -> a -> m (Step (PipeState s1 s2) b)) (s2 -> m (Step (PipeState s1 s2) b)) s1 

Instances

Instances details
Monad m => Arrow (Pipe m) Source # 
Instance details

Defined in Streamly.Internal.Data.Pipe.Type

Methods

arr :: (b -> c) -> Pipe m b c #

first :: Pipe m b c -> Pipe m (b, d) (c, d) #

second :: Pipe m b c -> Pipe m (d, b) (d, c) #

(***) :: Pipe m b c -> Pipe m b' c' -> Pipe m (b, b') (c, c') #

(&&&) :: Pipe m b c -> Pipe m b c' -> Pipe m b (c, c') #

Monad m => Category (Pipe m :: Type -> Type -> Type) Source # 
Instance details

Defined in Streamly.Internal.Data.Pipe.Type

Methods

id :: forall (a :: k). Pipe m a a #

(.) :: forall (b :: k) (c :: k) (a :: k). Pipe m b c -> Pipe m a b -> Pipe m a c #

Monad m => Functor (Pipe m a) Source # 
Instance details

Defined in Streamly.Internal.Data.Pipe.Type

Methods

fmap :: (a0 -> b) -> Pipe m a a0 -> Pipe m a b #

(<$) :: a0 -> Pipe m a b -> Pipe m a a0 #

Monad m => Applicative (Pipe m a) Source # 
Instance details

Defined in Streamly.Internal.Data.Pipe.Type

Methods

pure :: a0 -> Pipe m a a0 #

(<*>) :: Pipe m a (a0 -> b) -> Pipe m a a0 -> Pipe m a b #

liftA2 :: (a0 -> b -> c) -> Pipe m a a0 -> Pipe m a b -> Pipe m a c #

(*>) :: Pipe m a a0 -> Pipe m a b -> Pipe m a b #

(<*) :: Pipe m a a0 -> Pipe m a b -> Pipe m a a0 #

Monad m => Semigroup (Pipe m a b) Source # 
Instance details

Defined in Streamly.Internal.Data.Pipe.Type

Methods

(<>) :: Pipe m a b -> Pipe m a b -> Pipe m a b #

sconcat :: NonEmpty (Pipe m a b) -> Pipe m a b #

stimes :: Integral b0 => b0 -> Pipe m a b -> Pipe m a b #

data PipeState s1 s2 Source #

Represents a stateful transformation over an input stream of values of type a to outputs of type b in Monad m.

Constructors

Consume s1 
Produce s2 

zipWith :: Monad m => (a -> b -> c) -> Pipe m i a -> Pipe m i b -> Pipe m i c Source #

The composed pipe distributes the input to both the constituent pipes and zips the output of the two using a supplied zipping function.

Since: 0.7.0

tee :: Monad m => Pipe m a b -> Pipe m a b -> Pipe m a b Source #

The composed pipe distributes the input to both the constituent pipes and merges the outputs of the two.

Since: 0.7.0

map :: Monad m => (a -> b) -> Pipe m a b Source #

Lift a pure function to a Pipe.

Since: 0.7.0

compose :: Monad m => Pipe m b c -> Pipe m a b -> Pipe m a c Source #

Compose two pipes such that the output of the second pipe is attached to the input of the first pipe.

Since: 0.7.0