Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Set item
- new :: STM (Set item)
- newIO :: IO (Set item)
- null :: Set item -> STM Bool
- size :: Set item -> STM Int
- focus :: Hashable item => Focus () STM result -> item -> Set item -> STM result
- lookup :: Hashable item => item -> Set item -> STM Bool
- insert :: Hashable item => item -> Set item -> STM ()
- delete :: Hashable item => item -> Set item -> STM ()
- reset :: Set item -> STM ()
- unfoldlM :: Set item -> UnfoldlM STM item
- listT :: Set item -> ListT STM item
Documentation
newIO :: IO (Set item) Source #
Construct a new set in IO.
This is useful for creating it on a top-level using unsafePerformIO
,
because using atomically
inside unsafePerformIO
isn't possible.
focus :: Hashable item => Focus () STM result -> item -> Set item -> STM result Source #
Focus on an element with a strategy.
This function allows to perform simultaneous lookup and modification.
The strategy is over a unit since we already know, which element we're focusing on and it doesn't make sense to replace it, however we still can decide wether to keep or remove it.