Safe Haskell | None |
---|

Various conduit functions, mostly related to grouping or separating the items handled by conduits.

- concat :: Monad m => Conduit [a] m a
- simpleConcatFlush :: Monad m => Int -> Conduit [a] m (Flush a)
- concatFlush :: Monad m => b -> (b -> a -> ConduitM [a] (Flush a) m b) -> Conduit [a] m (Flush a)
- concatFlushSum :: (Num n, Ord n, Monad m) => (a -> n) -> n -> Conduit [a] m (Flush a)
- groupFlush :: Monad m => Conduit (Flush a) m [a]
- mchunk :: b -> (a -> b) -> Flush a -> b
- mapFlushMaybe :: Monad m => (a -> Maybe b) -> Conduit (Flush a) m (Flush b)

# Documentation

concat :: Monad m => Conduit [a] m aSource

Converts a stream of lists into a stream of single elements.

simpleConcatFlush :: Monad m => Int -> Conduit [a] m (Flush a)Source

Converts a stream of [a] into a stream of (Flush a). This is done by sending a Flush when the input is the empty list, or that we reached a certain threshold

concatFlush :: Monad m => b -> (b -> a -> ConduitM [a] (Flush a) m b) -> Conduit [a] m (Flush a)Source

This is a more general version of `simpleConcatFlush`

, where you
provide your own fold.

:: (Num n, Ord n, Monad m) | |

=> (a -> n) | Convert your input value into an Integer, usually a size |

-> n | The threshold value |

-> Conduit [a] m (Flush a) |

A generalized version of `simpleConcatFlush`

where some value is
summed and the `Flush`

is sent when it reaches a threshold.