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


-- | A buffer compatible with Data.Vector.*
--   
--   A buffer type that can easily be converted to a Data.Vector.Storable
--   vector from the vector package and compatible with hmatrix.
--   
--   Elements are pushed into the buffer. When the buffer is converted to a
--   read-only vector, the last-pushed element occurs at the end.
--   
--   Monadic map functions also operate so that the last-pushed element is
--   treated last.
@package vector-buffer
@version 0.4.1


-- | A buffer that can be used as a vector
module Data.Vector.Unboxed.Buffer
data Buffer a

-- | create a new buffer
newBuffer :: Unbox a => Int -> IO (Buffer a)

-- | add the next element to the buffer
pushNextElement :: Unbox a => Buffer a -> a -> IO ()

-- | convert to a vector
toVector :: Unbox a => Buffer a -> IO (Vector a)

-- | monadic map over a buffer
mapBufferM :: (Unbox a, Unbox b) => (a -> IO b) -> Buffer a -> IO (Vector b)

-- | monadic map over a buffer
mapBufferM_ :: (Unbox a) => (a -> IO b) -> Buffer a -> IO ()


-- | A buffer that can be used as a vector
module Data.Vector.Storable.Buffer
data Buffer a

-- | create a new buffer
newBuffer :: Storable a => Int -> IO (Buffer a)

-- | add the next element to the buffer
pushNextElement :: Storable a => Buffer a -> a -> IO ()

-- | convert to a vector
toVector :: (NFData a, Storable a) => Buffer a -> Vector a

-- | monadic map over a buffer
mapBufferM :: (Storable a, Storable b) => (a -> IO b) -> Buffer a -> IO (Vector b)

-- | monadic map over a buffer
mapBufferM_ :: (Storable a) => (a -> IO b) -> Buffer a -> IO ()
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Vector.Storable.Buffer.Buffer a)


-- | A buffer that can be used as a vector
module Data.Vector.Primitive.Buffer
data Buffer a

-- | create a new buffer
newBuffer :: Prim a => Int -> IO (Buffer a)

-- | add the next element to the buffer
pushNextElement :: Prim a => Buffer a -> a -> IO ()

-- | convert to a vector
toVector :: Prim a => Buffer a -> IO (Vector a)

-- | monadic map over a buffer
mapBufferM :: (Prim a, Prim b) => (a -> IO b) -> Buffer a -> IO (Vector b)

-- | monadic map over a buffer
mapBufferM_ :: Prim a => (a -> IO b) -> Buffer a -> IO ()


-- | A buffer that can be used as a vector
module Data.Vector.Buffer
data Buffer a

-- | create a new buffer
newBuffer :: Int -> IO (Buffer a)

-- | add the next element to the buffer
pushNextElement :: Buffer a -> a -> IO ()

-- | convert to a vector
toVector :: Buffer a -> IO (Vector a)

-- | monadic map over a buffer
mapBufferM :: (a -> IO b) -> Buffer a -> IO (Vector b)

-- | monadic map over a buffer
mapBufferM_ :: (a -> IO b) -> Buffer a -> IO ()
