A mutable vector which can increase in capacity.
Moduleproto-lens-0.7.1.5Haskell2010
Data.ProtoLens.Encoding.Growing
A mutable vector that grows in size.
Example usage:
import qualified Data.ProtoLens.Encoding.Growing as Growing
import qualified Data.Vector.Unboxed as V
test :: IO (V.Vector Int)
test = do
v <- Growing.new
v' <- Growing.append v 1
v'' <- Growing.append v' 2
v''' <- Growing.append v'' 3
unsafeFreeze v'''- 2 types
- 3 values
- Packageproto-lens-0.7.1.5
- Exports5
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceGrowing.hs
Create a new empty growing vector.
Returns a new growing vector with a new element at the end.
Note that the return value may share storage with the input value.
Furthermore, calling append twice on the same input may result
in two vectors that share the same storage.
Unsafely convert a growing vector to an immutable one without copying. After this call, you may not use the growing vector nor any other growing vectors that were used to produce this one.
RealWorld is deeply magical. It is primitive, but it is not
unlifted (hence ptrArg). We never manipulate values of type
RealWorld; it's only used in the type system, to parameterise State#.