sets-0.0.6.2: Ducktyped set interface for Haskell containers.

Safe HaskellNone
LanguageHaskell2010

Data.Set.Unordered.Many

Contents

Synopsis

Documentation

newtype UMSet a Source #

Unordered sets with duplicate elements. The semantics for "unordering" is based on the idea that we will not know what order the elements are in at any point, and we are free to re-order elements in any way.

Most binary functions are algorithmically heavier on the right arguments.

Pronounced "Unordered Many Set"

Constructors

UMSet 

Fields

Instances
Functor UMSet Source # 
Instance details

Defined in Data.Set.Unordered.Many

Methods

fmap :: (a -> b) -> UMSet a -> UMSet b #

(<$) :: a -> UMSet b -> UMSet a #

Mergeable UMSet Source # 
Instance details

Defined in Data.Set.Unordered.Many

Methods

mergeMap :: CommutativeId m => (a -> m) -> UMSet a -> m #

merge :: (a -> b -> b) -> b -> UMSet a -> b #

HasInsert a (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

insert :: a -> UMSet a -> UMSet a Source #

Eq a => HasDelete a (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

delete :: a -> UMSet a -> UMSet a Source #

HasSingleton a (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

singleton :: a -> UMSet a Source #

Eq a => Eq (UMSet a) Source # 
Instance details

Defined in Data.Set.Unordered.Many

Methods

(==) :: UMSet a -> UMSet a -> Bool #

(/=) :: UMSet a -> UMSet a -> Bool #

Show a => Show (UMSet a) Source # 
Instance details

Defined in Data.Set.Unordered.Many

Methods

showsPrec :: Int -> UMSet a -> ShowS #

show :: UMSet a -> String #

showList :: [UMSet a] -> ShowS #

Arbitrary a => Arbitrary (UMSet a) Source # 
Instance details

Defined in Data.Set.Unordered.Many

Methods

arbitrary :: Gen (UMSet a) #

shrink :: UMSet a -> [UMSet a] #

Eq a => CanBeProperSubset (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

isProperSubsetOf :: UMSet a -> UMSet a -> Bool Source #

Eq a => CanBeSubset (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

isSubsetOf :: UMSet a -> UMSet a -> Bool Source #

HasSize (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

size :: UMSet a -> Int Source #

HasEmpty (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

empty :: UMSet a Source #

Eq a => HasDifference (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

difference :: UMSet a -> UMSet a -> UMSet a Source #

Eq a => HasIntersection (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

intersection :: UMSet a -> UMSet a -> UMSet a Source #

Eq a => HasUnion (UMSet a) Source # 
Instance details

Defined in Data.Set.Class

Methods

union :: UMSet a -> UMSet a -> UMSet a Source #

Operators

(\\) :: Eq a => UMSet a -> UMSet a -> UMSet a Source #

Query

null :: UMSet a -> Bool Source #

O(1)

size :: UMSet a -> Int Source #

O(n)

member :: Eq a => a -> UMSet a -> Bool Source #

O(n)

notMember :: Eq a => a -> UMSet a -> Bool Source #

O(n)

lookup :: Eq a => a -> UMSet a -> Maybe a Source #

O(n)

isSubsetOf :: Eq a => UMSet a -> UMSet a -> Bool Source #

O(n*m)

isProperSubsetOf :: Eq a => UMSet a -> UMSet a -> Bool Source #

O(n*(m^3))

Construction

empty :: UMSet a Source #

O(1)

singleton :: a -> UMSet a Source #

O(1)

insert :: a -> UMSet a -> UMSet a Source #

O(1)

delete :: Eq a => a -> UMSet a -> UMSet a Source #

O(n)

Combine

union :: UMSet a -> UMSet a -> UMSet a Source #

O(n)

difference :: Eq a => UMSet a -> UMSet a -> UMSet a Source #

O(n*m)

intersection :: Eq a => UMSet a -> UMSet a -> UMSet a Source #

O(n*(m^4)) - Combines all elements of both

Filter

filter :: (a -> Bool) -> UMSet a -> UMSet a Source #

O(n)

partition :: (a -> Bool) -> UMSet a -> (UMSet a, UMSet a) Source #

O(n)

Map

map :: (a -> b) -> UMSet a -> UMSet b Source #

O(n)

mapMaybe :: (a -> Maybe b) -> UMSet a -> UMSet b Source #

O(?)