sets-0.0.5: Various set implementations in Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.Set.Class

Contents

Description

Convenience operators overloaded for arbitrary use. There are no laws associated with these classes, just duck-typed so we don't have to use the qualified versions of each function.

Synopsis

Union

class HasUnion s where Source

Methods

union :: s -> s -> s Source

Instances

HasUnion IntSet Source 
HasUnion (IntMap a) Source 
Ord a => HasUnion (Set a) Source 
HasUnion (Predicate a) Source 
(Hashable a, Eq a) => HasUnion (HashSet a) Source 
Ord a => HasUnion (FiniteSet a) Source 
Eq a => HasUnion (UUSet a) Source 
Eq a => HasUnion (UMSet a) Source 
Ord a => HasUnion (OMSet a) Source 
HasUnion a => HasUnion (XUnion a) Source 
HasUnion a => HasUnion (Intersection a) Source 
HasUnion a => HasUnion (Union a) Source 
Ord k => HasUnion (Map k a) Source 
(Hashable k, Eq k) => HasUnion (HashMap k a) Source 
Ord k => HasUnion (SetWith k a) Source 
(Ord k, HasUnion (c a)) => HasUnion (SetsWith k c a) Source 

unions :: (Foldable f, Monoid (Union s)) => f s -> s Source

unions1 :: (Foldable1 f, Semigroup (Union s)) => f s -> s Source

Intersection

intersections1 :: (Foldable1 f, Semigroup (Intersection s)) => f s -> s Source

Difference

(\\) :: HasDifference s => s -> s -> s Source

Exclusive Union / Symmetric Difference

class HasXUnion s where Source

Methods

xunion :: s -> s -> s Source

xunions :: (Foldable f, Monoid (XUnion s)) => f s -> s Source

xunions1 :: (Foldable1 f, Semigroup (XUnion s)) => f s -> s Source

Complement

Per-Element

class HasSingletonWith k a s where Source

Methods

singletonWith :: k -> a -> s Source

Instances

class HasDelete a s where Source

Methods

delete :: a -> s -> s Source

Instances

HasDelete Key IntSet Source 
Ord a => HasDelete a (FiniteSet a) Source 
Eq a => HasDelete a (UUSet a) Source 
Eq a => HasDelete a (UMSet a) Source 
Eq a => HasDelete a (OMSet a) Source 
Eq a => HasDelete a (Predicate a) Source 
(Hashable a, Eq a) => HasDelete a (HashSet a) Source 
Eq a => HasDelete a [a] Source 
Ord a => HasDelete a (Set a) Source 
HasDelete x a => HasDelete x (XUnion a) Source 
HasDelete x a => HasDelete x (Intersection a) Source 
HasDelete x a => HasDelete x (Union a) Source 
HasDelete Key (IntMap a) Source 
Ord k => HasDelete a (SetWith k a) Source 
(Hashable k, Eq k) => HasDelete k (HashMap k a) Source 
Ord k => HasDelete k (Map k a) Source 
(Ord k, Eq (c a), HasEmpty (c a), HasDelete a (c a)) => HasDelete a (SetsWith k c a) Source 

class HasInsert a s where Source

Methods

insert :: a -> s -> s Source

Instances

HasInsert Key IntSet Source 
Ord a => HasInsert a (FiniteSet a) Source 
Eq a => HasInsert a (UUSet a) Source 
HasInsert a (UMSet a) Source 
Ord a => HasInsert a (OMSet a) Source 
Eq a => HasInsert a (Predicate a) Source 
(Hashable a, Eq a) => HasInsert a (HashSet a) Source 
HasInsert a [a] Source 
Ord a => HasInsert a (Set a) Source 
HasInsert x a => HasInsert x (XUnion a) Source 
HasInsert x a => HasInsert x (Intersection a) Source 
HasInsert x a => HasInsert x (Union a) Source 
Ord k => HasInsert a (SetWith k a) Source 
(Ord k, HasUnion (c a), HasSingleton a (c a)) => HasInsert a (SetsWith k c a) Source 

class HasInsertWith k a s where Source

Methods

insertWith :: k -> a -> s -> s Source

Instances

HasInsertWith k x a => HasInsertWith k x (XUnion a) Source 
HasInsertWith k x a => HasInsertWith k x (Intersection a) Source 
HasInsertWith k x a => HasInsertWith k x (Union a) Source 
HasInsertWith Key a (IntMap a) Source 
(Hashable k, Eq k) => HasInsertWith k a (HashMap k a) Source 
Ord k => HasInsertWith k a (Map k a) Source 

Top and Bottom Elements

class HasTotal s where Source

Methods

total :: s Source

Size

Relation

Generic Builders

fromFoldable :: (Foldable f, HasInsert a s, HasEmpty s) => f a -> s Source

fromFoldableWithKey :: (FoldableWithKey f, HasInsertWith (Key f) a s, HasEmpty s) => f a -> s Source

fromFoldable1 :: (Foldable1 f, HasSingleton a s, Semigroup (Union s)) => f a -> s Source

fromFoldable1WithKey :: (FoldableWithKey1 f, HasSingletonWith (Key f) a s, Semigroup (Union s)) => f a -> s Source