impure-containers-0.5.1: Mutable containers in Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.HashMap.Mutable.Basic

Description

This whole module is mostly copied from the hashtables package. You can find much better documentation there. Additionally, if you problem in the implementation of a function, you should probably open up the issue on the hashtables github repo since Gregory is the one who actually authored (and the one who actually understands) this code. The main differences are as follows:

  • The type is named MHashMap instead of HashTable.
  • All functions are generalized to work in any PrimMonad instead of only ST.
  • The functions mapM_ and foldM have been curried. They do not take tuples here.
  • There is no type class used to overload the hashtable operations.
Synopsis

Documentation

data MHashMap s k v Source #

An open addressing hash table using linear probing.

Instances
Show (MHashMap s k v) Source # 
Instance details

Defined in Data.HashMap.Mutable.Basic

Methods

showsPrec :: Int -> MHashMap s k v -> ShowS #

show :: MHashMap s k v -> String #

showList :: [MHashMap s k v] -> ShowS #

new :: PrimMonad m => m (MHashMap (PrimState m) k v) Source #

delete :: (PrimMonad m, Hashable k, Eq k) => MHashMap (PrimState m) k v -> k -> m () Source #

lookup :: (PrimMonad m, Eq k, Hashable k) => MHashMap (PrimState m) k v -> k -> m (Maybe v) Source #

insert :: (PrimMonad m, Eq k, Hashable k) => MHashMap (PrimState m) k v -> k -> v -> m () Source #

mapM_ :: PrimMonad m => (k -> v -> m b) -> MHashMap (PrimState m) k v -> m () Source #

foldM :: PrimMonad m => (a -> k -> v -> m a) -> a -> MHashMap (PrimState m) k v -> m a Source #