unordered-containers-0.2.19.1: Efficient hashing-based container types
Safe Haskell None
Language Haskell2010

Data.HashMap.Internal.Array

Description

WARNING

This module is considered internal .

The Package Versioning Policy does not apply .

The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.

Authors importing this module are expected to track development closely.

Description

Zero based arrays.

Note that no bounds checking are performed.

Synopsis

Documentation

Creation

new :: Int -> a -> ST s ( MArray s a) Source #

Create a new mutable array of specified size, in the specified state thread, with each element containing the specified initial value.

Basic interface

update :: Array e -> Int -> e -> Array e Source #

\(O(n)\) Update the element at the given position in this array.

updateWith' :: Array e -> Int -> (e -> e) -> Array e Source #

\(O(n)\) Update the element at the given positio in this array, by applying a function to it. Evaluates the element to WHNF before inserting it into the array.

unsafeUpdateM :: Array e -> Int -> e -> ST s () Source #

\(O(1)\) Update the element at the given position in this array, without copying.

insert :: Array e -> Int -> e -> Array e Source #

\(O(n)\) Insert an element at the given position in this array, increasing its size by one.

insertM :: Array e -> Int -> e -> ST s ( Array e) Source #

\(O(n)\) Insert an element at the given position in this array, increasing its size by one.

delete :: Array e -> Int -> Array e Source #

\(O(n)\) Delete an element at the given position in this array, decreasing its size by one.

trim :: MArray s a -> Int -> ST s ( Array a) Source #

Create a new array of the n first elements of mary .

run :: ( forall s. ST s ( MArray s e)) -> Array e Source #

copy :: Array e -> Int -> MArray s e -> Int -> Int -> ST s () Source #

Unsafely copy the elements of an array. Array bounds are not checked.

copyM :: MArray s e -> Int -> MArray s e -> Int -> Int -> ST s () Source #

Unsafely copy the elements of an array. Array bounds are not checked.

Folds

foldl :: (b -> a -> b) -> b -> Array a -> b Source #

foldl' :: (b -> a -> b) -> b -> Array a -> b Source #

foldr :: (a -> b -> b) -> b -> Array a -> b Source #

foldr' :: (a -> b -> b) -> b -> Array a -> b Source #

all :: (a -> Bool ) -> Array a -> Bool Source #

Verifies that a predicate holds for all elements of an array.

map' :: (a -> b) -> Array a -> Array b Source #

Strict version of map .

shrink :: MArray s a -> Int -> ST s ( MArray s a) Source #

When shrinkSmallMutableArray# is available, the returned array is the same as the array given, as it is shrunk in place. Otherwise a copy is made.