StmHamt.SizedHamt

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

Safe Haskell | None
Language | Haskell2010

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

- data SizedHamt element
- new :: STM (SizedHamt element)
- newIO :: IO (SizedHamt element)
- null :: SizedHamt element -> STM Bool
- size :: SizedHamt element -> STM Int
- focus :: Hashable key => Focus element STM result -> (element -> key) -> key -> SizedHamt element -> STM result
- insert :: Hashable key => (element -> key) -> element -> SizedHamt element -> STM ()
- lookup :: Hashable key => (element -> key) -> key -> SizedHamt element -> STM (Maybe element)
- reset :: SizedHamt element -> STM ()
- unfoldlM :: SizedHamt a -> UnfoldlM STM a
- listT :: SizedHamt a -> ListT STM a

# Documentation

data SizedHamt element #

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

new :: STM (SizedHamt element) #

newIO :: IO (SizedHamt element) #

null :: SizedHamt element -> STM Bool #

O(1).

size :: SizedHamt element -> STM Int #

O(1).

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

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

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

reset :: SizedHamt element -> STM () #

unfoldlM :: SizedHamt a -> UnfoldlM STM a #

listT :: SizedHamt a -> ListT STM a #