haskus-utils-0.8.0.0: Haskus utility modules

Safe HaskellNone
LanguageHaskell2010

Haskus.Utils.STM.TSet

Description

STM mutable set

Synopsis

Documentation

type TSet a = Set a Source #

STM Set

null :: TSet a -> STM Bool Source #

Indicate if the set is empty

size :: TSet a -> STM Int Source #

Number of elements in the set

member :: Element e => e -> TSet e -> STM Bool Source #

Check if an element is in the set

notMember :: Element e => e -> TSet e -> STM Bool Source #

Check if an element is not in the set

empty :: STM (TSet e) Source #

Create an empty set

singleton :: Element e => e -> STM (TSet e) Source #

Create a set containing a single element

insert :: Element e => e -> TSet e -> STM () Source #

Insert an element in a set

delete :: Element e => e -> TSet e -> STM () Source #

Delete an element from a set

toList :: TSet e -> STM [e] Source #

Convert a set into a list

fromList :: Element e => [e] -> STM (TSet e) Source #

Create a set from a list

elems :: TSet e -> STM [e] Source #

Get the set elements

stream :: TSet e -> ListT STM e Source #

Get the set as a ListT stream

unions :: Element e => [TSet e] -> STM (TSet e) Source #

Perform a set union

map :: Element b => (a -> b) -> TSet a -> STM (TSet b) Source #

Apply a function to each element in the set