Copyright | © 2015 Patryk Zadarnowski <pat@jantar.org> |
---|---|
License | BSD3 |
Maintainer | pat@jantar.org |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
When binary data is streamed through a Quiver processor, it's often partitioned arbitrarily into packets with no semantic significance, beyond facilitation of processing in constant space. This is similar to the chunking mechanism within lazy bytestrings, and, accordingly, it's often convenient to unify the two mechanisms, by converting between processors over lazy bytestrings and processors over strict chunks of these bytestrings. This module provides efficient implementations of these conversions.
- toChunks :: Functor f => SP Lazy.ByteString ByteString.ByteString f [ByteString.ByteString]
- fromChunks :: Functor f => Int64 -> Int64 -> SP ByteString.ByteString Lazy.ByteString f [ByteString.ByteString]
Documentation
toChunks :: Functor f => SP Lazy.ByteString ByteString.ByteString f [ByteString.ByteString] Source
A processors that converts a stream of lazy bytestrings into a stream of their chunks.
fromChunks :: Functor f => Int64 -> Int64 -> SP ByteString.ByteString Lazy.ByteString f [ByteString.ByteString] Source
A processors that converts a stream of strict bytestring chunks into a stream of lazy bytestrings with the specified minimum and maximum size, without copying any data.