bytestring-tree-builder-0.2.7.12: A very efficient ByteString builder implementation based on the binary tree
Safe HaskellSafe-Inferred
LanguageHaskell2010

ByteString.TreeBuilder

Synopsis

Documentation

data Builder Source #

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

Instances

Instances details
IsString Builder Source # 
Instance details

Defined in ByteString.TreeBuilder

Methods

fromString :: String -> Builder #

Monoid Builder Source #

Implements mappend with O(1) complexity.

Instance details

Defined in ByteString.TreeBuilder

Semigroup Builder Source # 
Instance details

Defined in ByteString.TreeBuilder

Declaration

Primitives

byteString :: ByteString -> Builder Source #

Lifts a bytestring into the builder.

byte :: Word8 -> Builder Source #

Lifts a single byte into the builder.

Extras

intercalate :: (Foldable f, Monoid m) => m -> f m -> m Source #

Execution

length :: Builder -> Int Source #

O(1). Gets the total length.

toByteString :: Builder -> ByteString Source #

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

toLazyByteString :: Builder -> ByteString Source #

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