fold package:streaming-bytestring

fold keeps the return value of the left-folded bytestring. Useful for simultaneous folds over a segmented bytestream.
Like fold_, but suitable for use with mapped.
fold_, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteStream, reduces the ByteStream using the binary operator, from left to right. We use the style of the foldl library for left folds
Consume the chunks of an effectful ByteString with a left fold. Suitable for use with mapped.
foldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteStream, reduces the ByteStream using the binary operator, from right to left.
Consume the chunks of an effectful ByteString with a natural right fold.
fold_ keeps the return value of the left-folded bytestring. Useful for simultaneous folds over a segmented bytestream.
Like foldlChunks, but fold effectfully. Suitable for use with mapped.
Consume the chunks of an effectful ByteString with a natural right monadic fold.
chunkFold is preferable to foldlChunks since it is an appropriate argument for Control.Foldl.purely which permits many folds and sinks to be run simultaneously on one bytestream.
chunkFoldM is preferable to foldlChunksM since it is an appropriate argument for impurely which permits many folds and sinks to be run simultaneously on one bytestream.
O(n) The unfoldM function is analogous to the Stream unfoldr. unfoldM builds a ByteStream from a seed value. The function takes the element and returns Nothing if it is done producing the ByteStream or returns Just (a,b), in which case, a is a prepending to the ByteStream and b is used as the next element in a recursive call.
Like unfoldM, but yields a final r when the Word8 generation is complete.
cycle ties a finite ByteStream into a circular one, or equivalently, the infinite repetition of the original ByteStream. | O(n) The unfoldM function is analogous to the Stream 'unfoldr'. unfoldM builds a ByteStream from a seed value. The function takes the element and returns Nothing if it is done producing the ByteStream or returns Just (a,b), in which case, a is a prepending to the ByteStream and b is used as the next element in a recursive call.
Given some pure process that produces characters, generate a stream of bytes. The r produced by the final Left will be the return value at the end of the stream. Note also that the Char values will be truncated to 8-bits.
Given some continual monadic action that produces strict ByteString chunks, produce a stream of bytes.
Like unfoldMChunks, but feed through a final r return value.
Internal utility for unfoldr.