unison-prelude-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Util.Set

Synopsis

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.

insertMaybe :: Ord a => Maybe a -> Set a -> Set a Source #

intersects :: Ord a => Set a -> Set a -> Bool Source #

Get whether two sets intersect.

mapMaybe :: Ord b => (a -> Maybe b) -> Set a -> Set b Source #

symmetricDifference :: Ord a => Set a -> Set a -> Set a Source #

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

for :: (Ord b, Applicative f) => Set a -> (a -> f b) -> f (Set b) Source #

flatMap :: Ord b => (a -> Set b) -> Set a -> Set b Source #

filterM :: (Ord a, Monad m) => (a -> m Bool) -> Set a -> m (Set a) Source #

forMaybe :: (Ord b, Applicative f) => Set a -> (a -> f (Maybe b)) -> f (Set b) Source #

thenInsert :: Ord a => Set a -> a -> Set a Source #

thenInsertMaybe :: Ord a => Set a -> Maybe a -> Set a Source #