Safe Haskell | None |
---|---|
Language | Haskell2010 |
A dynamically resizeable array in the ST monad. Indices begin at 0.
Documentation
Create a new, empty array, with a current capacity of 16, which doubles in size whenever it exceeds capacity.
emptyWith :: Int -> (Int -> Int) -> ST s (DynArray s e)
Create a new, empty array with a particular size and growth strategy.
(!) :: DynArray s e -> Int -> ST s e
Read from the array at a given index. If the index has not yet been written to, behavior is undefined.