Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Dense integer hash map.
Synopsis
- data DenseHashMap s a = DenseHashMap {}
- newHM :: (Unbox a, PrimMonad m) => Int -> m (DenseHashMap (PrimState m) a)
- sizeHM :: PrimMonad m => DenseHashMap (PrimState m) a -> m Int
- clearHM :: PrimMonad m => DenseHashMap (PrimState m) a -> m ()
- hashHM :: DenseHashMap a s -> Int -> Int
- indexHM :: PrimMonad m => DenseHashMap (PrimState m) a -> Int -> m Int
- memberHM :: (HasCallStack, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m Bool
- readHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m a
- readMayHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m (Maybe a)
- writeHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> a -> m ()
- exchangeHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> a -> m (Maybe a)
- modifyHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> (a -> a) -> Int -> m ()
- deleteHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m (Maybe a)
- deleteHM_ :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> Int -> m ()
- unsafeAssocsHM :: (HasCallStack, Unbox a, PrimMonad m) => DenseHashMap (PrimState m) a -> m (Vector (Int, a))
Documentation
data DenseHashMap s a #
Dense int map that holds up up n
values.
DenseHashMap | |
|
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.