Copyright | (c) 2018 Composewell Technologies (c) Roman Leshchinskiy 2008-2010 |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Streamly.Internal.Data.Pipe might ultimately replace this module.
Synopsis
- transform :: Monad m => Pipe m a b -> Stream m a -> Stream m b
- map :: Monad m => (a -> b) -> Stream m a -> Stream m b
- mapM :: Monad m => (a -> m b) -> Stream m a -> Stream m b
- sequence :: Monad m => Stream m (m a) -> Stream m a
- tap :: Monad m => Fold m a b -> Stream m a -> Stream m a
- tapOffsetEvery :: Monad m => Int -> Int -> Fold m a b -> Stream m a -> Stream m a
- tapRate :: (MonadAsync m, MonadCatch m) => Double -> (Int -> m b) -> Stream m a -> Stream m a
- pollCounts :: MonadAsync m => (a -> Bool) -> (Stream m Int -> Stream m Int) -> Fold m Int b -> Stream m a -> Stream m a
- foldrS :: Monad m => (a -> Stream m b -> Stream m b) -> Stream m b -> Stream m a -> Stream m b
- foldrT :: (Monad m, Monad (t m), MonadTrans t) => (a -> t m b -> t m b) -> t m b -> Stream m a -> t m b
- foldlS :: Monad m => (Stream m b -> a -> Stream m b) -> Stream m b -> Stream m a -> Stream m b
- foldlT :: (Monad m, Monad (s m), MonadTrans s) => (s m b -> a -> s m b) -> s m b -> Stream m a -> s m b
- postscanOnce :: Monad m => Fold m a b -> Stream m a -> Stream m b
- scanOnce :: Monad m => Fold m a b -> Stream m a -> Stream m b
- scanlM' :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> Stream m b
- scanlMAfter' :: Monad m => (b -> a -> m b) -> m b -> (b -> m b) -> Stream m a -> Stream m b
- scanl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> Stream m b
- scanlM :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> Stream m b
- scanl :: Monad m => (b -> a -> b) -> b -> Stream m a -> Stream m b
- scanl1M' :: Monad m => (a -> a -> m a) -> Stream m a -> Stream m a
- scanl1' :: Monad m => (a -> a -> a) -> Stream m a -> Stream m a
- scanl1M :: Monad m => (a -> a -> m a) -> Stream m a -> Stream m a
- scanl1 :: Monad m => (a -> a -> a) -> Stream m a -> Stream m a
- prescanl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> Stream m b
- prescanlM' :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> Stream m b
- postscanl :: Monad m => (a -> b -> a) -> a -> Stream m b -> Stream m a
- postscanlM :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> Stream m b
- postscanl' :: Monad m => (a -> b -> a) -> a -> Stream m b -> Stream m a
- postscanlM' :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> Stream m b
- postscanlMAfter' :: Monad m => (b -> a -> m b) -> m b -> (b -> m b) -> Stream m a -> Stream m b
- postscanlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> Stream m b
- postscanlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> Stream m b
- scanlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> Stream m b
- scanlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> Stream m b
- filter :: Monad m => (a -> Bool) -> Stream m a -> Stream m a
- filterM :: Monad m => (a -> m Bool) -> Stream m a -> Stream m a
- deleteBy :: Monad m => (a -> a -> Bool) -> a -> Stream m a -> Stream m a
- uniq :: (Eq a, Monad m) => Stream m a -> Stream m a
- take :: Monad m => Int -> Stream m a -> Stream m a
- takeByTime :: (MonadIO m, TimeUnit64 t) => t -> Stream m a -> Stream m a
- takeWhile :: Monad m => (a -> Bool) -> Stream m a -> Stream m a
- takeWhileM :: Monad m => (a -> m Bool) -> Stream m a -> Stream m a
- drop :: Monad m => Int -> Stream m a -> Stream m a
- dropByTime :: (MonadIO m, TimeUnit64 t) => t -> Stream m a -> Stream m a
- dropWhile :: Monad m => (a -> Bool) -> Stream m a -> Stream m a
- dropWhileM :: Monad m => (a -> m Bool) -> Stream m a -> Stream m a
- insertBy :: Monad m => (a -> a -> Ordering) -> a -> Stream m a -> Stream m a
- intersperse :: Monad m => a -> Stream m a -> Stream m a
- intersperseM :: Monad m => m a -> Stream m a -> Stream m a
- intersperseSuffix :: forall m a. Monad m => m a -> Stream m a -> Stream m a
- intersperseSuffixBySpan :: forall m a. Monad m => Int -> m a -> Stream m a -> Stream m a
- intersperseM_ :: Monad m => m b -> Stream m a -> Stream m a
- intersperseSuffix_ :: Monad m => m b -> Stream m a -> Stream m a
- reverse :: Monad m => Stream m a -> Stream m a
- reverse' :: forall m a. (MonadIO m, Storable a) => Stream m a -> Stream m a
- indexed :: Monad m => Stream m a -> Stream m (Int, a)
- indexedR :: Monad m => Int -> Stream m a -> Stream m (Int, a)
- findIndices :: Monad m => (a -> Bool) -> Stream m a -> Stream m Int
- rollingMap :: Monad m => (a -> a -> b) -> Stream m a -> Stream m b
- rollingMapM :: Monad m => (a -> a -> m b) -> Stream m a -> Stream m b
- mapMaybe :: Monad m => (a -> Maybe b) -> Stream m a -> Stream m b
- mapMaybeM :: Monad m => (a -> m (Maybe b)) -> Stream m a -> Stream m b
Piping
Pass through a Pipe
.
Mapping
Stateless one-to-one maps.
mapM :: Monad m => (a -> m b) -> Stream m a -> Stream m b Source #
Map a monadic function over a Stream
Mapping Effects
tapRate :: (MonadAsync m, MonadCatch m) => Double -> (Int -> m b) -> Stream m a -> Stream m a Source #
pollCounts :: MonadAsync m => (a -> Bool) -> (Stream m Int -> Stream m Int) -> Fold m Int b -> Stream m a -> Stream m a Source #
Folding
foldrS :: Monad m => (a -> Stream m b -> Stream m b) -> Stream m b -> Stream m a -> Stream m b Source #
foldrT :: (Monad m, Monad (t m), MonadTrans t) => (a -> t m b -> t m b) -> t m b -> Stream m a -> t m b Source #
foldlS :: Monad m => (Stream m b -> a -> Stream m b) -> Stream m b -> Stream m a -> Stream m b Source #
foldlT :: (Monad m, Monad (s m), MonadTrans s) => (s m b -> a -> s m b) -> s m b -> Stream m a -> s m b Source #
Scanning By Fold
Scanning
Left scans. Stateful, mostly one-to-one maps.
scanlMAfter' :: Monad m => (b -> a -> m b) -> m b -> (b -> m b) -> Stream m a -> Stream m b Source #
postscanlMAfter' :: Monad m => (b -> a -> m b) -> m b -> (b -> m b) -> Stream m a -> Stream m b Source #
postscanlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> Stream m b Source #
Filtering
Produce a subset of the stream.
Trimming
Produce a subset of the stream trimmed at ends.
takeByTime :: (MonadIO m, TimeUnit64 t) => t -> Stream m a -> Stream m a Source #
dropByTime :: (MonadIO m, TimeUnit64 t) => t -> Stream m a -> Stream m a Source #
Inserting Elements
Produce a superset of the stream.
intersperseSuffixBySpan :: forall m a. Monad m => Int -> m a -> Stream m a -> Stream m a Source #
intersperse after every n items
Inserting Side Effects
Reordering
Produce strictly the same set but reordered.
Position Indexing
Searching
Rolling map
Map using the previous element.