piped-0.1.0.0: Conduit with a smaller core

Safe HaskellSafe
LanguageHaskell2010

Piped.Extras

Description

Convenience methods, plus bracketPipe.

Synopsis

Documentation

sourceList :: (Monad m, Foldable t) => t o -> Pipe () o m () Source #

Yield all values from a foldable data structure such as a list.

sinkList :: Pipe i Void m [i] Source #

Return all input values as a list.

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

Consume all values using given function

sinkNull :: Monad m => Pipe i Void m () Source #

Discard all input values

awaitMaybe :: Pipe i o m a -> (i -> Pipe i o m a) -> Pipe i o m a Source #

Basically `await >>= maybe ...`, but avoids the conversion to a maybe type.

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

Act on a value, if there is no value then return ().

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

Yield the result of a monadic action.

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

This is the same as bracketP from Conduit, however it's not specialised to MonadResource.