Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Builder.ST
Documentation
Builder for an array of boxed elements. This type is appropriate
when constructing an array of unknown size in an effectful
(ST
or IO
) setting. In a non-effectful setting, consider
the Builder
from Data.Builder
instead.
A Builder
must be used linearly. The type system does not
enforce this, so users must be careful when handling a Builder
.
Constructors
Builder !(SmallMutableArray s a) !Int !Int !(Chunks a) |
Arguments
:: a | Element to push onto the end |
-> Builder s a | Builder, do not reuse this after pushing onto it |
-> ST s (Builder s a) | New builder |
Push an element onto the end of the builder. This is not strict in the element, so force it before pushing it on to the builder if doing so is needed to prevent space leaks.