Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Basic functionality, closely mirroring the list / Foldable api from Prelude.
This module should be imported qualified i.e. `import Piped.Prelude as P`.
Synopsis
- filter :: Monad m => (i -> Bool) -> Pipe i i m ()
- takeWhile :: Monad m => (i -> Bool) -> Pipe i i m ()
- dropWhile :: Monad m => (i -> Bool) -> Pipe i o m ()
- identity :: Monad m => Pipe i i m ()
- scanl :: forall i o m. (o -> i -> o) -> o -> Pipe i o m ()
- foldl :: Monad m => (a -> i -> a) -> a -> Pipe i o m a
- drop :: Monad m => Int -> Pipe i o m ()
- take :: Monad m => Int -> Pipe i i m ()
- map :: Monad m => (i -> o) -> Pipe i o m ()
- mapM :: Monad m => (i -> m o) -> Pipe i o m ()
- mapM_ :: Monad m => (i -> m ()) -> Pipe i () m ()
- tail :: Monad m => Pipe i i m ()
- last :: Monad m => Pipe i o m (Maybe i)
- zip :: Monad m => Pipe () o m () -> Pipe () o' m () -> Pipe () (o, o') m ()
- zipWith :: Monad m => (o -> o' -> a) -> Pipe () o m () -> Pipe () o' m () -> Pipe () a m ()
- concat :: (Foldable t, Monad m) => Pipe (t i) i m ()
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 (>>).
drop :: Monad m => Int -> Pipe i o m () Source #
Drop n values.
Note: This will not yield values and should be combined with >>
mapM_ :: Monad m => (i -> m ()) -> Pipe i () m () Source #
Map a monadic function over input values but don't yield anything.
zip :: Monad m => Pipe () o m () -> Pipe () o' m () -> Pipe () (o, o') m () Source #
Zip two pipes together.