HsJudy-0.2: Judy bindings, and some nice APIs

Data.Array.Judy.BitSet

Synopsis

Documentation

newtype HashIO a => BitSet a Source

Constructors

BitSet 

Fields

judy :: ForeignPtr Judy1
 

Instances

swapBitSets :: BitSet a -> BitSet a -> IO ()Source

Swap contents of two sets.

new :: HashIO a => IO (BitSet a)Source

Create a set.

insert :: HashIO a => a -> BitSet a -> IO ()Source

Add a value to the set.

delete :: HashIO a => a -> BitSet a -> IO ()Source

Delete a value in the set.

set :: HashIO a => BitSet a -> a -> Bool -> IO BoolSource

Set value in or out the set and return its old value.

get :: HashIO a => BitSet a -> a -> IO BoolSource

member :: HashIO a => a -> BitSet a -> IO BoolSource

Is the value a member of the set?

null :: BitSet a -> IO BoolSource

Is the set empty?

size :: BitSet a -> IO IntSource

Cardinality of the set.

clear :: HashIO a => BitSet a -> IO ()Source

Make the set empty.

toList :: Enum a => BitSet t -> IO [a]Source

Convert the set to a list of elements.

fromList :: HashIO a => [a] -> BitSet a -> IO ()Source

Create a set from a list of elements. FIXME: should I create the list here maybe?

freezeBitSet :: HashIO a => BitSet a -> IO (Frozen (BitSet a))Source

Create a frozen, immutable version of a bitset, the original mutable version is cleared.

memberF :: HashIO a => a -> Frozen (BitSet a) -> BoolSource

fromListF :: HashIO a => [a] -> Frozen (BitSet a)Source

toListF :: Enum a => Frozen (BitSet t) -> [a]Source