Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Set a
- empty :: Set a
- singleton :: a -> Set a
- null :: Set a -> Bool
- member :: Ord a => a -> Set a -> Bool
- size :: Set a -> Int
- difference :: Ord a => Set a -> Set a -> Set a
- (\\) :: Ord a => Set a -> Set a -> Set a
- intersection :: Ord a => Set a -> Set a -> Set a
- subset :: Ord a => Set a -> Set a -> Bool
- toArray :: Set a -> Array a
- toList :: Set a -> [a]
- fromList :: Ord a => [a] -> Set a
- foldr :: (a -> b -> b) -> b -> Set a -> b
- foldl' :: (b -> a -> b) -> b -> Set a -> b
- foldr' :: (a -> b -> b) -> b -> Set a -> b
- foldMap' :: Monoid m => (a -> m) -> Set a -> m
- foldMap :: Monoid m => (a -> m) -> Set a -> m
- traverse_ :: Applicative m => (a -> m b) -> Set a -> m ()
- itraverse_ :: Applicative m => (Int -> a -> m b) -> Set a -> m ()
Documentation
Instances
subset :: Ord a => Set a -> Set a -> Bool Source #
Is the first argument a subset of the second argument?
Conversion
toArray :: Set a -> Array a Source #
O(1) Convert a set to an array. The elements are given in ascending order. This function is zero-cost.
Folds
foldr :: (a -> b -> b) -> b -> Set a -> b Source #
Right fold over the elements in the set. This is lazy in the accumulator.
foldMap' :: Monoid m => (a -> m) -> Set a -> m Source #
Strict monoidal fold over the elements in the set.
foldMap :: Monoid m => (a -> m) -> Set a -> m Source #
Lazy monoidal fold over the elements in the set.
Traversals
traverse_ :: Applicative m => (a -> m b) -> Set a -> m () Source #
Traverse a set, discarding the result.
itraverse_ :: Applicative m => (Int -> a -> m b) -> Set a -> m () Source #
Traverse a set with the indices, discarding the result.