vector-buffer-0.4.1: A buffer compatible with Data.Vector.*

Copyright(c) A.V.H. McPhail 2011
LicenseBSD3
MaintainerVivian McPhail <haskell.vivian.mcphail@gmail.com>
Stabilityprovisional
Safe HaskellNone
LanguageHaskell98

Data.Vector.Storable.Buffer

Description

A buffer that can be used as a vector

Synopsis

Documentation

data Buffer a Source

Instances

NFData a => NFData (Buffer a) 

newBuffer Source

Arguments

:: Storable a 
=> Int

Size

-> IO (Buffer a) 

create a new buffer

pushNextElement :: Storable a => Buffer a -> a -> IO () Source

add the next element to the buffer

toVector :: (NFData a, Storable a) => Buffer a -> Vector a Source

convert to a vector

mapBufferM :: (Storable a, Storable b) => (a -> IO b) -> Buffer a -> IO (Vector b) Source

monadic map over a buffer

mapBufferM_ :: Storable a => (a -> IO b) -> Buffer a -> IO () Source

monadic map over a buffer