grapesy
Safe HaskellNone
LanguageHaskell2010

Network.GRPC.Common.NextElem

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

Conversion

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.

collect :: Monad m => m (NextElem a) -> m [a] Source #

Invoke the callback until it returns NoNextElem, collecting results