piped-0.1.0.0: Conduit with a smaller core

Safe HaskellSafe
LanguageHaskell2010

Piped.Prelude

Description

Basic functionality, closely mirroring the list / Foldable api from Prelude.

This module should be imported qualified i.e. `import Piped.Prelude as P`.

Synopsis

Documentation

filter :: Monad m => (i -> Bool) -> Pipe i i m () Source #

Yield only elements satisfying a predicate.

takeWhile :: Monad m => (i -> Bool) -> Pipe i i m () Source #

Yield values while they satisfy a predicate, then return.

dropWhile :: Monad m => (i -> Bool) -> Pipe i o m () Source #

Drop values while they satisfy a predicate, then return.

Note: this does not yield any values, and should be combined with (>>).

identity :: Monad m => Pipe i i m () Source #

Equivalent to `map id`.

scanl :: forall i o m. (o -> i -> o) -> o -> Pipe i o m () Source #

map with an accumulator.

foldl :: Monad m => (a -> i -> a) -> a -> Pipe i o m a Source #

Left fold over input values.

drop :: Monad m => Int -> Pipe i o m () Source #

Drop n values.

Note: This will not yield values and should be combined with >>

take :: Monad m => Int -> Pipe i i m () Source #

Take n values.

map :: Monad m => (i -> o) -> Pipe i o m () Source #

Map a pure function over input values.

mapM :: Monad m => (i -> m o) -> Pipe i o m () Source #

Map a monadic function over input values.

mapM_ :: Monad m => (i -> m ()) -> Pipe i () m () Source #

Map a monadic function over input values but don't yield anything.

tail :: Monad m => Pipe i i m () Source #

Skip the first value

last :: Monad m => Pipe i o m (Maybe i) Source #

Return the last value.

zip :: Monad m => Pipe () o m () -> Pipe () o' m () -> Pipe () (o, o') m () Source #

Zip two pipes together.

zipWith :: Monad m => (o -> o' -> a) -> Pipe () o m () -> Pipe () o' m () -> Pipe () a m () Source #

Zip two pipes together with a pure function.

concat :: (Foldable t, Monad m) => Pipe (t i) i m () Source #

Concatenate foldable inputs to a single stream of outputs.