| bytestring-0.9.0.1.1: Fast, packed, strict and lazy byte arrays with a list interface | Source code | Contents | Index

Data.ByteString.Lazy.Internal

Portability | portable
Stability | experimental
Maintainer | dons@cse.unsw.edu.au, duncan@haskell.org

Contents

The lazy `ByteString` type and representation
Data type invariant and abstraction function
Chunk allocation sizes

Description
A module containing semi-public `ByteString` internals. This exposes the `ByteString` representation and low level construction functions. Modules which extend the `ByteString` system will need to use this module while ideally most users will be able to make do with the public interface modules.
Synopsis

data ByteString

= Empty
| Chunk !ByteString ByteString

chunk :: ByteString -> ByteString -> ByteString
foldrChunks :: (ByteString -> a -> a) -> a -> ByteString -> a
foldlChunks :: (a -> ByteString -> a) -> a -> ByteString -> a
invariant :: ByteString -> Bool
checkInvariant :: ByteString -> ByteString
defaultChunkSize :: Int
smallChunkSize :: Int
chunkOverhead :: Int

The lazy `ByteString` type and representation

data ByteString | Source

A space-efficient representation of a Word8 vector, supporting many efficient operations. A `ByteString` contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable
Constructors

Empty |
Chunk !ByteString ByteString |

Instances

Data ByteString
Eq ByteString
Monoid ByteString
Ord ByteString
Read ByteString
Show ByteString
Typeable ByteString

chunk :: ByteString -> ByteString -> ByteString | Source

Smart constructor for `Chunk`. Guarantees the data type invariant.

foldrChunks :: (ByteString -> a -> a) -> a -> ByteString -> a | Source

Consume the chunks of a lazy ByteString with a natural right fold.

foldlChunks :: (a -> ByteString -> a) -> a -> ByteString -> a | Source

Consume the chunks of a lazy ByteString with a strict, tail-recursive, accumulating left fold.
Data type invariant and abstraction function

invariant :: ByteString -> Bool | Source

The data type invariant: Every ByteString is either `Empty` or consists of non-null `ByteString`s. All functions must preserve this, and the QC properties must check this.

checkInvariant :: ByteString -> ByteString | Source

In a form that checks the invariant lazily.
Chunk allocation sizes

defaultChunkSize :: Int | Source

Currently set to 32k, less the memory management overhead

smallChunkSize :: Int | Source

Currently set to 4k, less the memory management overhead

chunkOverhead :: Int | Source

The memory management overhead. Currently this is tuned for GHC only.
Produced by Haddock version 0.9