priority-map-0.1.0.0: The priority map data structure is a map combined with a heap

Safe HaskellNone
LanguageHaskell2010

Data.PriorityMap.STMap

Description

A typeclass which represents mutable key-value map data structures in the ST monad. Keys must be in the Ord typeclass.

Documentation

class STMap m where

Minimal complete definition

mEmpty, mSize, mModify, mLookup, mToList, mInsert

Methods

mEmpty :: ST s (m s k v)

mSize :: m s k v -> ST s Int

mModify :: Ord k => m s k v -> k -> Maybe v -> ST s ()

mLookup :: Ord k => m s k v -> k -> ST s (Maybe v)

mToList :: m s k v -> ST s [(k, v)]

mDelete :: Ord k => m s k v -> k -> ST s ()

mInsert :: Ord k => m s k v -> (k, v) -> ST s ()

Instances

newtype MapST s k v

Constructors

MapST (STRef s (Map k v)) 

Instances

modify :: MapST s k v -> (Map k v -> Map k v) -> ST s ()

get :: MapST s k v -> (Map k v -> a) -> ST s a