toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.DenseHashMap

Description

Synopsis

Documentation

data DenseHashMap s a #

Dense int map that holds up up n values.

Constructors

DenseHashMap 

Fields

newHM :: (Unbox a, PrimMonad m) => Int -> m (DenseHashMap (PrimState m) a) #

\(O(N)\) Creates a hashmap.

sizeHM :: PrimMonad m => DenseHashMap (PrimState m) a -> m Int #

\(O(1)\) Returns the number of stored elements. Not tested

clearHM :: PrimMonad m => DenseHashMap (PrimState m) a -> m () #

\(O(1)\) Clears the buffer. Not tested

hashHM :: DenseHashMap a s -> Int -> Int #

\(O(1)\) (Internal) Hash value calculation.

indexHM :: PrimMonad m => DenseHashMap (PrimState m) a -> Int -> m Int #

\(O(1)\) (Internal) Hashed slot search.

memberHM :: (HasCallStack, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m Bool #

\(O(1)\)

readHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m a #

\(O(1)\)

readMayHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m (Maybe a) #

\(O(1)\)

writeHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> a -> m () #

\(O(1)\)

exchangeHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> a -> m (Maybe a) #

\(O(1)\)

modifyHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> (a -> a) -> Int -> m () #

\(O(1)\) Not tested.

deleteHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m (Maybe a) #

\(O(1)\) Deletes a value. Not tested

deleteHM_ :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m () #

\(O(1)\) Deletes a value. Not tested

unsafeAssocsHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> m (Vector (Int, a)) #

\(O(N)\) Enumerates the stored key-value pairs.