Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Unison.Util.Set
Synopsis
- asSingleton :: Set a -> Maybe a
- difference1 :: Ord a => Set a -> Set a -> Maybe (Set a)
- differenceMap :: Ord k => Set k -> Map k a -> Set k
- foldCommutativeM :: Monad m => (a -> b -> m b) -> b -> Set a -> m b
- insertMaybe :: Ord a => Maybe a -> Set a -> Set a
- intersects :: Ord a => Set a -> Set a -> Bool
- mapMaybe :: Ord b => (a -> Maybe b) -> Set a -> Set b
- symmetricDifference :: Ord a => Set a -> Set a -> Set a
- traverse :: (Applicative f, Ord b) => (a -> f b) -> Set a -> f (Set b)
- for :: (Ord b, Applicative f) => Set a -> (a -> f b) -> f (Set b)
- flatMap :: Ord b => (a -> Set b) -> Set a -> Set b
- filterM :: (Ord a, Monad m) => (a -> m Bool) -> Set a -> m (Set a)
- forMaybe :: (Ord b, Applicative f) => Set a -> (a -> f (Maybe b)) -> f (Set b)
- thenInsert :: Ord a => Set a -> a -> Set a
- thenInsertMaybe :: Ord a => Set a -> Maybe a -> Set a
Documentation
asSingleton :: Set a -> Maybe a Source #
Get the only member of a set, iff it's a singleton.
difference1 :: Ord a => Set a -> Set a -> Maybe (Set a) Source #
Set difference, but return Nothing
if the difference is empty.
differenceMap :: Ord k => Set k -> Map k a -> Set k Source #
Like difference
, but the second argument is a map.
foldCommutativeM :: Monad m => (a -> b -> m b) -> b -> Set a -> m b Source #
Fold a set strictly with a monadic "commutative" combining function that doesn't receive the elements in any particular order.