storablevector-0.2.12.1: Fast, packed, strict storable arrays with a list interface like ByteString

Safe HaskellNone
LanguageHaskell98

Data.StorableVector.Lazy.Builder

Description

Build a lazy storable vector by incrementally adding an element. This is analogous to Data.Binary.Builder for Data.ByteString.Lazy.

Attention: This implementation is still almost 3 times slower than constructing a lazy storable vector using unfoldr in our Chorus speed test.

Synopsis

Documentation

data Builder a Source #

Instances

Storable a => Monoid (Builder a) Source # 

Methods

mempty :: Builder a #

mappend :: Builder a -> Builder a -> Builder a #

mconcat :: [Builder a] -> Builder a #

toLazyStorableVector :: Storable a => ChunkSize -> Builder a -> Vector a Source #

toLazyStorableVector (ChunkSize 7) $ foldMap put ['a'..'z']

put :: Storable a => a -> Builder a Source #

flush :: Storable a => Builder a Source #

Set a laziness break.