Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.GRPC.Common.NextElem
Contents
Description
Elements in a stream (without metadata)
Intended for qualified import.
import Network.GRPC.Common.NextElem qualified as NextElem
Network.GRPC.Common (intended for unqualified import) exports
NextElem(..)
, but none of the operations on NextElem
.
Synopsis
- toStreamElem :: b -> NextElem a -> StreamElem b a
- mapM_ :: Monad m => (NextElem a -> m ()) -> [a] -> m ()
- forM_ :: Monad m => [a] -> (NextElem a -> m ()) -> m ()
- whileNext_ :: Monad m => m (NextElem a) -> (a -> m ()) -> m ()
- collect :: Monad m => m (NextElem a) -> m [a]
Conversion
toStreamElem :: b -> NextElem a -> StreamElem b a Source #
Iteration
mapM_ :: Monad m => (NextElem a -> m ()) -> [a] -> m () Source #
Invoke the callback for each element, and then once more with NoNextElem
mapM_ f [1,2,3] == do f (NextElem 1) f (NextElem 2) f (NextElem 3) f NoNextElem
forM_ :: Monad m => [a] -> (NextElem a -> m ()) -> m () Source #
Like mapM_
, but with the arguments in opposite order
whileNext_ :: Monad m => m (NextElem a) -> (a -> m ()) -> m () Source #
Invoke a function on each NextElem
, until NoNextElem
See also collect
.