When growing the vector, capacity will be multiplied by this number.
This is usually chosen between 1.5 and 2; 2 being the most common.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelinear-base-0.4.0Haskell2010
When growing the vector, capacity will be multiplied by this number.
This is usually chosen between 1.5 and 2; 2 being the most common.
Functor VectorDefined in linear-base-0.4.0 · Data.Vector.Mutable.Linear.InternalSemigroup (Vector a)Defined in linear-base-0.4.0 · Data.Vector.Mutable.Linear.InternalConsumable (Vector a)Defined in linear-base-0.4.0 · Data.Vector.Mutable.Linear.InternalDupable (Vector a)Defined in linear-base-0.4.0 · Data.Vector.Mutable.Linear.InternalSemigroup (Vector a)Defined in linear-base-0.4.0 · Data.Vector.Mutable.Linear.InternalAllocate a constant vector of a given non-negative size (and error on a bad size)
Allocator from a list
Number of elements inside the vector.
This might be different than how much actual memory the vector is using. For that, see: capacity.
Capacity of a vector. In other words, the number of elements the vector can contain before it is copied to a bigger array.
Insert at the end of the vector. This will grow the vector if there is no empty space.
Pop from the end of the vector. This will never shrink the vector, use shrinkToFit to remove the wasted space.
Write to an element . Note: this will not write to elements beyond the current size of the vector and will error instead.
Same as write, but does not do bounds-checking. The behaviour is undefined when passed an invalid index.
Read from a vector, with an in-range index and error for an index that is
out of range (with the usual range 0..size-1).
Same as read, but does not do bounds-checking. The behaviour is undefined when passed an invalid index.
Same as modify, but does not do bounds-checking.
Modify a value inside a vector, with an ability to return an extra information. Errors if the index is out of bounds.
Same as modify, but without the ability to return extra information.
Return the vector elements as a lazy list.
Filters the vector in-place. It does not deallocate unused capacity, use shrinkToFit for that if necessary.
A version of fmap which can throw out elements.
Resize the vector to not have any wasted memory (size == capacity). This returns a semantically identical vector.
Return a slice of the vector with given size, starting from an offset.
Start offset + target size should be within the input vector, and both should be non-negative.
This is a constant time operation if the start offset is 0. Use shrinkToFit to remove the possible wasted space if necessary.
Same as unsafeSafe, but takes the Vector as the first parameter.
Grows the vector to the closest power of growthFactor to fit at least n more elements.
Resize the vector to a non-negative size. In-range elements are preserved, the possible new elements are bottoms.
Check if given index is within the Vector, otherwise panic.