sets-0.0.5: Various set implementations in Haskell.

Safe HaskellSafe
LanguageHaskell2010

Data.Set.Ordered.Unique.Finite

Contents

Synopsis

Documentation

Operators

(\\) :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a Source

O(n+m)

Query

null :: Eq a => FiniteSet a -> Bool Source

O(1)

size :: FiniteSet a -> Int Source

O(1)

member :: Ord a => a -> FiniteSet a -> Bool Source

O(log n)

notMember :: Ord a => a -> FiniteSet a -> Bool Source

O(log n)

isSubsetOf :: Ord a => FiniteSet a -> FiniteSet a -> Bool Source

O(n+m+t1+t2)

isProperSubsetOf :: Ord a => FiniteSet a -> FiniteSet a -> Bool Source

O(n+m+t1+t2)

Construction

empty :: Set a -> FiniteSet a Source

O(1)

singleton :: Set a -> a -> FiniteSet a Source

O(1)

insert :: Ord a => a -> FiniteSet a -> FiniteSet a Source

O(log n)

delete :: Ord a => a -> FiniteSet a -> FiniteSet a Source

O(log n)

Combine

union :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a Source

O(n+m)

difference :: Ord a => FiniteSet a -> FiniteSet a -> FiniteSet a Source

O(n+m)

complement :: Ord a => FiniteSet a -> FiniteSet a Source

/O(n+t)

Filter

filter :: (a -> Bool) -> FiniteSet a -> FiniteSet a Source

O(n)

partition :: (a -> Bool) -> FiniteSet a -> (FiniteSet a, FiniteSet a) Source

O(n) - Guaranteed to be disjoint

Map

map :: Ord b => (a -> b) -> FiniteSet a -> FiniteSet b Source

O(n)