Copyright | (c) 2017 Composewell Technologies |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Low level functions using StreamK as the intermediate stream type. These functions are used in SerialTAsyncTAheadT/ParallelT stream modules to implement their instances..
Synopsis
- drain :: Monad m => Stream m a -> m ()
- fromList :: Monad m => [a] -> Stream m a
- toList :: Monad m => Stream m a -> m [a]
- foldrM :: Monad m => (a -> m b -> m b) -> m b -> Stream m a -> m b
- foldrMx :: Monad m => (a -> m x -> m x) -> m x -> (m x -> m b) -> Stream m a -> m b
- foldr :: Monad m => (a -> b -> b) -> b -> Stream m a -> m b
- foldlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> m b
- foldlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> m b
- foldl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> m b
- fold :: Monad m => Fold m a b -> Stream m a -> m b
- eqBy :: Monad m => (a -> b -> Bool) -> Stream m a -> Stream m b -> m Bool
- cmpBy :: Monad m => (a -> b -> Ordering) -> Stream m a -> Stream m b -> m Ordering
Running Effects
Conversion operations
fromList :: Monad m => [a] -> Stream m a Source #
fromList =foldr
cons
nil
Construct a stream from a list of pure values. This is more efficient than
fromFoldable
for serial streams.
Since: 0.4.0
toList :: Monad m => Stream m a -> m [a] Source #
Convert a stream into a list in the underlying monad.
Since: 0.1.0
Fold operations
foldlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> m b Source #
Strict left fold with an extraction function. Like the standard strict
left fold, but applies a user supplied extraction function (the third
argument) to the folded value at the end. This is designed to work with the
foldl
library. The suffix x
is a mnemonic for extraction.
Since: 0.7.0
foldlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> m b Source #
Like foldlx'
, but with a monadic step function.
Since: 0.7.0
foldl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> m b Source #
Strict left associative fold.
Since: 0.2.0