| Copyright | (c) 2021 Composewell Technologies |
|---|---|
| License | BSD-3-Clause |
| Maintainer | streamly@composewell.com |
| Stability | experimental |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
Streamly.Internal.Data.Producer.Type
Description
See Streamly.Internal.Data.Producer for introduction.
Synopsis
- data Producer m a b = forall s. Producer (s -> m (Step s b)) (a -> m s) (s -> m a)
- nil :: Monad m => Producer m a b
- nilM :: Monad m => (a -> m c) -> Producer m a b
- unfoldrM :: Monad m => (a -> m (Maybe (b, a))) -> Producer m a b
- fromList :: Monad m => Producer m [a] a
- translate :: Functor m => (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b
- lmap :: (a -> a) -> Producer m a b -> Producer m a b
- data NestedLoop s1 s2
- concat :: Monad m => Producer m a b -> Producer m b c -> Producer m (NestedLoop a b) c
Type
A Producer m a b is a generator of a stream of values of type b from a
seed of type a in Monad m.
Pre-release
Producers
fromList :: Monad m => Producer m [a] a Source #
Convert a list of pure values to a Stream
Pre-release
Mapping
translate :: Functor m => (a -> c) -> (c -> a) -> Producer m c b -> Producer m a b Source #
Interconvert the producer between two interconvertible input types.
Pre-release
lmap :: (a -> a) -> Producer m a b -> Producer m a b Source #
Map the producer input to another value of the same type.
Pre-release
Nesting
data NestedLoop s1 s2 Source #
State representing a nested loop.