Module

Pipes.Prelude

Package
purescript-pipes
Repository
felixSchl/purescript-pipes

#repeatM Source

repeatM :: forall r m a. Monad m => m a -> Producer_ a m r

Repeat a monadic action indefinitely, yielding each result

#replicateM Source

replicateM :: forall m a. Monad m => Int -> m a -> Producer_ a m Unit

Repeat a monadic action a fixed number of times, yielding each result

#mapM_ Source

mapM_ :: forall r m a. Monad m => (a -> m Unit) -> Consumer_ a m r

Consume all values using a monadic function

#drain Source

drain :: forall r m a. Monad m => Consumer_ a m r

discard all incoming values

#map Source

map :: forall r m b a. Monad m => (a -> b) -> Pipe a b m r

Apply a function to all values flowing downstream

#mapM Source

mapM :: forall r m b a. Monad m => (a -> m b) -> Pipe a b m r

Apply a monadic function to all values flowing downstream

#sequence Source

sequence :: forall r m a. Monad m => Pipe (m a) a m r

Convert a stream of actions to a stream of values

#mapFoldable Source

mapFoldable :: forall r t m b a. Monad m => Foldable t => (a -> t b) -> Pipe a b m r

Apply a function to all values flowing downstream, and

#filter Source

filter :: forall r m a. Monad m => (a -> Boolean) -> Pipe a a m r

filter only forwards values that satisfy the predicate.

#filterM Source

filterM :: forall r m a. Monad m => (a -> m Boolean) -> Pipe a a m r

filterM only forwards values that satisfy the monadic predicate

#take Source

take :: forall m a. Monad m => Int -> Pipe a a m Unit

take n only allows n values to pass through

#takeWhile Source

takeWhile :: forall m a. Monad m => (a -> Boolean) -> Pipe a a m Unit

takeWhile allows values to pass downstream so long as they satisfy

#takeWhile' Source

takeWhile' :: forall m a. Monad m => (a -> Boolean) -> Pipe a a m a

takeWhile' is a version of takeWhile that returns the value failing

#drop Source

drop :: forall r m a. Monad m => Int -> Pipe a a m r

drop discards n values going downstream

#dropWhile Source

dropWhile :: forall r m a. Monad m => (a -> Boolean) -> Pipe a a m r

dropWhile discards values going downstream until one violates the

#concat Source

concat :: forall r f m a. Monad m => Foldable f => Pipe (f a) a m r

Flatten all 'Foldable' elements flowing downstream

#findIndices Source

findIndices :: forall r m a. Monad m => (a -> Boolean) -> Pipe a Int m r

Outputs the indices of all elements that satisfied the predicate

#scan Source

scan :: forall r m x b a. Monad m => (x -> a -> x) -> x -> (x -> b) -> Pipe a b m r

Left scan

#scanM Source

scanM :: forall r m x b a. Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Pipe a b m r

Monadic left scan

#chain Source

chain :: forall r m a. Monad m => (a -> m Unit) -> Pipe a a m r

Apply an action to all values flowing downstream

#show Source

show :: forall r m a. Monad m => Show a => Pipe a String m r

Convert Showable values to Strings

#seq Source

seq :: forall r m a. Monad m => Pipe a a m r

Evaluate all values flowing downstream to WHNF XXX: Is this needed in purescript?

#fold Source

fold :: forall m x b a. Monad m => (x -> a -> x) -> x -> (x -> b) -> Producer a m Unit -> m b

Fold of the elements of a Producer

#fold' Source

fold' :: forall r m x b a. Monad m => (x -> a -> x) -> x -> (x -> b) -> Producer a m r -> m (Tuple b r)

Fold of the elements of a Producer that preserves the return value

#foldM Source

foldM :: forall m x b a. Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Producer a m Unit -> m b

Monadic fold of the elements of a Producer

#foldM' Source

foldM' :: forall r m x b a. Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Producer a m r -> m (Tuple b r)

Monadic fold of the elements of a Producer

#all Source

all :: forall m a. Monad m => (a -> Boolean) -> Producer a m Unit -> m Boolean

all determines whether all the elements of p satisfy the predicate.

#any Source

any :: forall m a. Monad m => (a -> Boolean) -> Producer a m Unit -> m Boolean

any determines whether any element of p satisfies the predicate.

#and Source

and :: forall m. Monad m => Producer Boolean m Unit -> m Boolean

Determines whether all elements are True

#or Source

or :: forall m. Monad m => Producer Boolean m Unit -> m Boolean

Determines whether any element is True

#elem Source

elem :: forall m a. Monad m => Eq a => a -> Producer a m Unit -> m Boolean

elem returns True if p has an element equal to a, False otherwise

#notElem Source

notElem :: forall m a. Monad m => Eq a => a -> Producer a m Unit -> m Boolean

notElem returns False if p has an element equal to a, True otherwise

#find Source

find :: forall m a. Monad m => (a -> Boolean) -> Producer a m Unit -> m (Maybe a)

Find the first element of a Producer that satisfies the predicate

#findIndex Source

findIndex :: forall m a. Monad m => (a -> Boolean) -> Producer a m Unit -> m (Maybe Int)

Find the index of the first element of a Producer that satisfies the

#head Source

head :: forall m a. Monad m => Producer a m Unit -> m (Maybe a)

Retrieve the first element from a Producer

#index Source

index :: forall m a. Monad m => Int -> Producer a m Unit -> m (Maybe a)

Index into a Producer

#last Source

last :: forall m a. Monad m => Producer a m Unit -> m (Maybe a)

Retrieve the last element from a Producer

#length Source

length :: forall m a. Monad m => Producer a m Unit -> m Int

Count the number of elements in a Producer

#maximum Source

maximum :: forall m a. Monad m => Ord a => Producer a m Unit -> m (Maybe a)

Find the maximum element of a Producer

#minimum Source

minimum :: forall m a. Monad m => Ord a => Producer a m Unit -> m (Maybe a)

Find the minimum element of a Producer

#null Source

null :: forall m a. Monad m => Producer a m Unit -> m Boolean

Determine if a Producer is empty

#toList Source

toList :: forall a. Producer a Identity Unit -> List a

Convert a pure Producer into a list

#toListM Source

toListM :: forall m a. Monad m => Producer a m Unit -> m (List a)