reducers-3.12.3: Semigroups, specialized containers and a general map/reduce framework

Safe HaskellTrustworthy
LanguageHaskell98

Data.Semigroup.Union

Contents

Synopsis

Documentation

Unions of Containers

class HasUnion f where Source #

A Container suitable for the Union Monoid

Minimal complete definition

union

Methods

union :: f -> f -> f Source #

Instances
HasUnion IntSet Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: IntSet -> IntSet -> IntSet Source #

Eq a => HasUnion [a] Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: [a] -> [a] -> [a] Source #

HasUnion (IntMap a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: IntMap a -> IntMap a -> IntMap a Source #

Ord a => HasUnion (Set a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

(Eq a, Hashable a) => HasUnion (HashSet a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: HashSet a -> HashSet a -> HashSet a Source #

Ord k => HasUnion (Map k a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: Map k a -> Map k a -> Map k a Source #

(Eq k, Hashable k) => HasUnion (HashMap k a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

union :: HashMap k a -> HashMap k a -> HashMap k a Source #

class HasUnion f => HasUnion0 f where Source #

Minimal complete definition

empty

Methods

empty :: f Source #

Instances
HasUnion0 IntSet Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: IntSet Source #

Eq a => HasUnion0 [a] Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: [a] Source #

HasUnion0 (IntMap a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: IntMap a Source #

Ord a => HasUnion0 (Set a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: Set a Source #

(Eq a, Hashable a) => HasUnion0 (HashSet a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: HashSet a Source #

Ord k => HasUnion0 (Map k a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: Map k a Source #

(Eq k, Hashable k) => HasUnion0 (HashMap k a) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

empty :: HashMap k a Source #

newtype Union f Source #

Constructors

Union 

Fields

Instances
Functor Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

Foldable Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

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

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

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

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

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

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

toList :: Union a -> [a] #

null :: Union a -> Bool #

length :: Union a -> Int #

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

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

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

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

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

Traversable Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

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

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

Traversable1 Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

traverse1 :: Apply f => (a -> f b) -> Union a -> f (Union b) #

sequence1 :: Apply f => Union (f b) -> f (Union b) #

Foldable1 Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

fold1 :: Semigroup m => Union m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Union a -> m #

toNonEmpty :: Union a -> NonEmpty a #

HasUnion f => Reducer f (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

unit :: f -> Union f Source #

snoc :: Union f -> f -> Union f Source #

cons :: f -> Union f -> Union f Source #

Eq f => Eq (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

(==) :: Union f -> Union f -> Bool #

(/=) :: Union f -> Union f -> Bool #

Ord f => Ord (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

compare :: Union f -> Union f -> Ordering #

(<) :: Union f -> Union f -> Bool #

(<=) :: Union f -> Union f -> Bool #

(>) :: Union f -> Union f -> Bool #

(>=) :: Union f -> Union f -> Bool #

max :: Union f -> Union f -> Union f #

min :: Union f -> Union f -> Union f #

Read f => Read (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Show f => Show (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

showsPrec :: Int -> Union f -> ShowS #

show :: Union f -> String #

showList :: [Union f] -> ShowS #

HasUnion f => Semigroup (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

(<>) :: Union f -> Union f -> Union f #

sconcat :: NonEmpty (Union f) -> Union f #

stimes :: Integral b => b -> Union f -> Union f #

HasUnion0 f => Monoid (Union f) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

mempty :: Union f #

mappend :: Union f -> Union f -> Union f #

mconcat :: [Union f] -> Union f #

Unions of Containers of Semigroups

class Functor f => HasUnionWith f where Source #

Polymorphic containers that we can supply an operation to handle unions with

Minimal complete definition

unionWith

Methods

unionWith :: (a -> a -> a) -> f a -> f a -> f a Source #

Instances
HasUnionWith IntMap Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a Source #

Ord k => HasUnionWith (Map k) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

unionWith :: (a -> a -> a) -> Map k a -> Map k a -> Map k a Source #

(Eq k, Hashable k) => HasUnionWith (HashMap k) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

unionWith :: (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a Source #

class HasUnionWith f => HasUnionWith0 f where Source #

Minimal complete definition

emptyWith

Methods

emptyWith :: f a Source #

Instances
HasUnionWith0 IntMap Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

emptyWith :: IntMap a Source #

Ord k => HasUnionWith0 (Map k) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

emptyWith :: Map k a Source #

(Eq k, Hashable k) => HasUnionWith0 (HashMap k) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

emptyWith :: HashMap k a Source #

newtype UnionWith f m Source #

The Monoid ('unionWith mappend',empty) for containers full of monoids.

Constructors

UnionWith 

Fields

Instances
(HasUnionWith f, Semigroup m, Monoid m) => Reducer (f m) (UnionWith f m) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

unit :: f m -> UnionWith f m Source #

snoc :: UnionWith f m -> f m -> UnionWith f m Source #

cons :: f m -> UnionWith f m -> UnionWith f m Source #

(HasUnionWith f, Semigroup m) => Semigroup (UnionWith f m) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

(<>) :: UnionWith f m -> UnionWith f m -> UnionWith f m #

sconcat :: NonEmpty (UnionWith f m) -> UnionWith f m #

stimes :: Integral b => b -> UnionWith f m -> UnionWith f m #

(HasUnionWith0 f, Monoid m) => Monoid (UnionWith f m) Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

mempty :: UnionWith f m #

mappend :: UnionWith f m -> UnionWith f m -> UnionWith f m #

mconcat :: [UnionWith f m] -> UnionWith f m #