vector-builder-0.3.1: Vector builder

Safe Haskell | None
Language | Haskell2010

VectorBuilder.Builder

Synopsis

- data Builder element
- empty :: Builder element
- singleton :: element -> Builder element
- vector :: Vector vector element => vector element -> Builder element

# Documentation

data Builder element #

An abstraction over the size of a vector for the process of its construction.

It postpones the actual construction of a vector until the execution of the builder.

Instances

Semigroup (Builder element) # | Provides support for O(1) concatenation.
Methods (<>) :: Builder element -> Builder element -> Builder element # sconcat :: NonEmpty (Builder element) -> Builder element # stimes :: Integral b => b -> Builder element -> Builder element #
Monoid (Builder element) # | Provides support for O(1) concatenation.
Methods mempty :: Builder element # mappend :: Builder element -> Builder element -> Builder element # mconcat :: [Builder element] -> Builder element #

empty :: Builder element #

Empty builder.

singleton :: element -> Builder element #

Builder of a single element.

vector :: Vector vector element => vector element -> Builder element #

Builder from an immutable vector of elements.

Supports all kinds of vectors: boxed, unboxed, primitive, storable.