hgeometry-combinatorial-0.11.0.0: Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.List.Set

Synopsis

Documentation

data Set a Source #

A Set of as, implemented using a simple list. The only advantage of this implementation over Set from containers is that most operations require only 'Eq a' rather than 'Ord a'.

Instances
Functor Set Source # 
Instance details

Defined in Data.List.Set

Methods

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

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

Foldable Set Source # 
Instance details

Defined in Data.List.Set

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Traversable Set Source # 
Instance details

Defined in Data.List.Set

Methods

traverse :: Applicative f => (a -> f b) -> Set a -> f (Set b) #

sequenceA :: Applicative f => Set (f a) -> f (Set a) #

mapM :: Monad m => (a -> m b) -> Set a -> m (Set b) #

sequence :: Monad m => Set (m a) -> m (Set a) #

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

Defined in Data.List.Set

Methods

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

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

Read a => Read (Set a) Source # 
Instance details

Defined in Data.List.Set

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

Defined in Data.List.Set

Methods

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

show :: Set a -> String #

showList :: [Set a] -> ShowS #

Eq a => Semigroup (Set a) Source # 
Instance details

Defined in Data.List.Set

Methods

(<>) :: Set a -> Set a -> Set a #

sconcat :: NonEmpty (Set a) -> Set a #

stimes :: Integral b => b -> Set a -> Set a #

Eq a => Monoid (Set a) Source # 
Instance details

Defined in Data.List.Set

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

singleton :: a -> Set a Source #

Creates a singleton set.

insert :: Eq a => a -> Set a -> Set a Source #

Inserts an element in the set

running time: \(O(n)\)

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

Deletes an element from the set

running time: \(O(n)\)

union :: Eq a => Set a -> Set a -> Set a Source #

Computes the union of two sets

running time: \(O(n^2)\)

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

Computes the intersection of two sets

running time: \(O(n^2)\)

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

Computes the difference of two sets

running time: \(O(n^2)\)

fromList :: Eq a => [a] -> Set a Source #

insertAll :: Eq a => [a] -> Set a -> Set a Source #