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

Safe HaskellNone
LanguageHaskell2010

ByteString.TreeBuilder

Contents

Synopsis

Documentation

data Builder Source #

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

Instances
IsString Builder Source # 
Instance details

Defined in ByteString.TreeBuilder

Methods

fromString :: String -> Builder #

Semigroup Builder Source # 
Instance details

Defined in ByteString.TreeBuilder

Monoid Builder Source #

Implements mappend with O(1) complexity.

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.