bytestring-tree-builder-0.2.6: A very efficient ByteString builder implementation based on the binary tree

Safe HaskellNone
LanguageHaskell2010

ByteString.TreeBuilder

Contents

Synopsis

Documentation

data Builder

A binary-tree-based datastructure optimized for aggregation of bytestrings using the O(1) appending operation.

Instances

IsString Builder 
Monoid Builder

Implements mappend with O(1) complexity.

Semigroup Builder 

Declaration

Primitives

byteString :: ByteString -> Builder

Lifts a bytestring into the builder.

byte :: Word8 -> Builder

Lifts a single byte into the builder.

Extras

Execution

length :: Builder -> Int

O(1). Gets the total length.

toByteString :: Builder -> ByteString

O(n). Converts the builder into a strict bytestring.

toLazyByteString :: Builder -> ByteString

O(n). Converts the builder into a lazy bytestring.