Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Set a
- singleton :: a -> Set a
- insert :: Eq a => a -> Set a -> Set a
- delete :: Eq a => a -> Set a -> Set a
- union :: Eq a => Set a -> Set a -> Set a
- intersection :: Eq a => Set a -> Set a -> Set a
- difference :: Eq a => Set a -> Set a -> Set a
- fromList :: Eq a => [a] -> Set a
- insertAll :: Eq a => [a] -> Set a -> Set a
Documentation
A Set of a
s, 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 # | |
Foldable Set Source # | |
Defined in Data.List.Set 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 # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # | |
Traversable Set Source # | |
Eq a => Eq (Set a) Source # | |
Read a => Read (Set a) Source # | |
Show a => Show (Set a) Source # | |
Eq a => Semigroup (Set a) Source # | |
Eq a => Monoid (Set a) Source # | |
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)\)