The data type invariant: Every ByteString is either Empty or consists of non-null StrictByteStrings. All functions must preserve this.
Modulerebase-1.21.2Haskell2010
Rebase.Data.ByteString.Lazy.Internal
- 2 types
- 14 values
- Packagerebase-1.21.2
- Exports16
- LanguageHaskell2010
- LicenceMIT
- SourceInternal.hs
A space-efficient representation of a Word8 vector, supporting many efficient operations.
A LazyByteString contains 8-bit bytes, or by using the operations from Data.ByteString.Lazy.Char8 it can be interpreted as containing 8-bit characters.
Constructors
Instances14IsList, Eq, Data, Ord, Read, Show, …
IsList ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalEq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalOrd ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalRead ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalShow ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalIsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
Semigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalMonoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalNFData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalBinary ByteStringDefined in binary-0.8.9.3 · Data.Binary.ClassHashable ByteStringDefined in hashable-1.4.7.0 · Data.Hashable.ClassLift ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internaltype Item ByteString = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
Smart constructor for Chunk. Guarantees the data type invariant.
The chunk size used for I/O. Currently set to 32k, less the memory management overhead
Consume the chunks of a lazy ByteString with a strict, tail-recursive, accumulating left fold.
Consume the chunks of a lazy ByteString with a natural right fold.
The recommended chunk size. Currently set to 4k, less the memory management overhead
O(1) Convert a StrictByteString into a LazyByteString.
O(n) Convert a LazyByteString into a StrictByteString.
Note that this is an expensive operation that forces the whole LazyByteString into memory and then copies all the data. If possible, try to avoid converting back and forth between strict and lazy bytestrings.
Type synonym for the lazy flavour of ByteString.
The memory management overhead. Currently this is tuned for GHC only.
Lazily checks that the given ByteString satisfies the data type's "no empty chunks" invariant, raising an exception in place of the first chunk that does not satisfy the invariant.