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

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 #

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 Source #

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

Foldable Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

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

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

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

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

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

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

toList :: Union a -> [a] Source #

null :: Union a -> Bool Source #

length :: Union a -> Int Source #

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

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

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

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

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

Traversable Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

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

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

Traversable1 Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

Foldable1 Union Source # 
Instance details

Defined in Data.Semigroup.Union

Methods

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

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

toNonEmpty :: Union a -> NonEmpty a Source #

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 Source #

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

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

Defined in Data.Semigroup.Union

Methods

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

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

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

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

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

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

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

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

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

Defined in Data.Semigroup.Union

Methods

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

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

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

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

Defined in Data.Semigroup.Union

Methods

mempty :: Union f Source #

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

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

Unions of Containers of Semigroups

class Functor f => HasUnionWith f where Source #

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

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 #

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 Source #

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

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

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

Defined in Data.Semigroup.Union