-- 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. . [Usage]
--   . 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. . [Example] . The following code shows how you can
--   efficiently concatenate different datastructures into a single
--   immutable vector: . &gt; &gt;import qualified Data.Vector as A
--   &gt;import qualified VectorBuilder.Builder as B &gt;import qualified
--   VectorBuilder.Vector as C &gt; &gt; &gt;myVector :: A.Vector a -&gt;
--   [a] -&gt; a -&gt; A.Vector a &gt;myVector vector list element = &gt;
--   C.build builder &gt; where &gt; builder = &gt; B.vector vector
--   &lt;&gt; &gt; B.foldable list &lt;&gt; &gt; B.singleton element
@package vector-builder
@version 0.3.8.7


-- | 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)

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

-- | Gets the size of a Builder.
size :: Builder element -> Int

-- | Builder from an immutable vector of elements.
--   
--   Supports all kinds of vectors: boxed, unboxed, primitive, storable.
vector :: Vector vector element => vector element -> Builder element
foldable :: Foldable foldable => foldable element -> Builder 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


-- | MonadPlus utilities. For instance, they can be applied with parsing
--   libraries.
module VectorBuilder.MonadPlus
many :: (MonadPlus m, Vector vector element) => m element -> m (vector element)
manyBuilder :: MonadPlus m => m element -> m (Builder element)
many1 :: (MonadPlus m, Vector vector element) => m element -> m (vector element)
sepBy :: (MonadPlus m, Vector vector element) => m element -> m separator -> m (vector element)
sepBy1 :: (MonadPlus m, Vector vector element) => m element -> m separator -> m (vector element)


-- | Alternative utilities. For instance, they can be applied with parsing
--   libraries.
module VectorBuilder.Alternative
many :: (Alternative m, Vector vector a) => m a -> m (vector a)
manyBuilder :: Alternative m => m a -> m (Builder a)
some :: (Alternative m, Vector vector a) => m a -> m (vector a)
someBuilder :: Alternative m => m a -> m (Builder a)
