-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Vector builder
--   
--   An API for efficient and convenient construction of vectors. It
--   provides the composable <a>Builder</a> abstraction, which has
--   instances of the <a>Monoid</a> and <a>Semigroup</a> classes.
--   
--   <ul>
--   <li><i>Usage</i></li>
--   </ul>
--   
--   First you use the <a>Builder</a> abstraction to specify the structure
--   of the vector. Then you execute the builder to actually produce the
--   vector.
--   
--   <ul>
--   <li><i>Example</i></li>
--   </ul>
--   
--   The following code shows how you can efficiently concatenate different
--   datastructures into a single immutable vector:
--   
--   <pre>
--   import qualified Data.Vector as A
--   import qualified VectorBuilder.Builder as B
--   import qualified VectorBuilder.Vector as C
--   
--   
--   myVector :: A.Vector a -&gt; [a] -&gt; a -&gt; A.Vector a
--   myVector vector list element =
--     C.build builder
--     where
--       builder =
--         B.vector vector &lt;&gt;
--         foldMap B.singleton list &lt;&gt;
--         B.singleton element
--   </pre>
@package vector-builder
@version 0.3.1


-- | Extensions to the standard mutable Vector API.
module VectorBuilder.MVector

-- | Construct a mutable vector from a builder.
--   
--   Supports all kinds of vectors: boxed, unboxed, primitive, storable.
build :: MVector vector element => Builder element -> ST s (vector s element)


-- | Extensions to the standard immutable Vector API.
module VectorBuilder.Vector

-- | Construct an immutable vector from a builder.
--   
--   Supports all kinds of vectors: boxed, unboxed, primitive, storable.
build :: Vector vector element => Builder element -> vector element

module VectorBuilder.Builder

-- | 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.
data Builder element

-- | Empty builder.
empty :: Builder element

-- | Builder of a single element.
singleton :: element -> Builder element

-- | Builder from an immutable vector of elements.
--   
--   Supports all kinds of vectors: boxed, unboxed, primitive, storable.
vector :: Vector vector element => vector element -> Builder element
