stm-hamt-1.2.0.1: STM-specialised Hash Array Mapped Trie

Safe HaskellNone
LanguageHaskell2010

StmHamt.SizedHamt

Description

HAMT API, optimized for a fast size operation. That however comes at the cost of a small overhead in the other operations.

Synopsis

Documentation

data SizedHamt element Source #

STM-specialized Hash Array Mapped Trie, extended with its size-tracking functionality, allowing for a fast size operation.

new :: STM (SizedHamt element) Source #

newIO :: IO (SizedHamt element) Source #

null :: SizedHamt element -> STM Bool Source #

O(1).

size :: SizedHamt element -> STM Int Source #

O(1).

focus :: (Eq key, Hashable key) => Focus element STM result -> (element -> key) -> key -> SizedHamt element -> STM result Source #

insert :: (Eq key, Hashable key) => (element -> key) -> element -> SizedHamt element -> STM () Source #

lookup :: (Eq key, Hashable key) => (element -> key) -> key -> SizedHamt element -> STM (Maybe element) Source #

reset :: SizedHamt element -> STM () Source #