Module

Pipes.Prelude

Package
purescript-pipes
Repository
felixSchl/purescript-pipes

#repeatM Source

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

Repeat a monadic action indefinitely, yielding each result

#replicateM Source

replicateM :: forall a m. 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 a m r. Monad m => (a -> m Unit) -> Consumer_ a m r

Consume all values using a monadic function

#drain Source

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

discard all incoming values

#map Source

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

Apply a function to all values flowing downstream

#mapM Source

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

Apply a monadic function to all values flowing downstream

#sequence Source

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

Convert a stream of actions to a stream of values

#mapFoldable Source

mapFoldable :: forall a b m t r. 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 a m r. Monad m => (a -> Boolean) -> Pipe a a m r

filter only forwards values that satisfy the predicate.

#filterM Source

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

filterM only forwards values that satisfy the monadic predicate

#take Source

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

take n only allows n values to pass through

#takeWhile Source

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

takeWhile allows values to pass downstream so long as they satisfy

#takeWhile' Source

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

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

#drop Source

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

drop discards n values going downstream

#dropWhile Source

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

dropWhile discards values going downstream until one violates the

#concat Source

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

Flatten all 'Foldable' elements flowing downstream

#findIndices Source

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

Outputs the indices of all elements that satisfied the predicate

#scan Source

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

Left scan

#scanM Source

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

Monadic left scan

#chain Source

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

Apply an action to all values flowing downstream

#show Source

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

Convert Showable values to Strings

#seq Source

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

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

#fold Source

fold :: forall a b x m. 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 a b x m r. 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 a b x m. 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 a b x m r. 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 a m. 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 a m. 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 a m. 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 a m. 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 a m. 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 a m. 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 a m. Monad m => Producer a m Unit -> m (Maybe a)

Retrieve the first element from a Producer

#index Source

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

Index into a Producer

#last Source

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

Retrieve the last element from a Producer

#length Source

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

Count the number of elements in a Producer

#maximum Source

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

Find the maximum element of a Producer

#minimum Source

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

Find the minimum element of a Producer

#null Source

null :: forall a m. 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 a m. Monad m => Producer a m Unit -> m (List a)