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

Data.Semigroup.Union

Synopsis

Unions of Containers

class HasUnion f where Source

A Container suitable for the `Union` `Monoid`

Methods

union :: f -> f -> f Source

Instances

 HasUnion IntSet Eq a => HasUnion [a] HasUnion (IntMap a) Ord a => HasUnion (Set a) (Eq a, Hashable a) => HasUnion (HashSet a) Ord k => HasUnion (Map k a) (Eq k, Hashable k) => HasUnion (HashMap k a)

class HasUnion f => HasUnion0 f where Source

Methods

empty :: f Source

Instances

 HasUnion0 IntSet Eq a => HasUnion0 [a] HasUnion0 (IntMap a) Ord a => HasUnion0 (Set a) (Eq a, Hashable a) => HasUnion0 (HashSet a) Ord k => HasUnion0 (Map k a) (Eq k, Hashable k) => HasUnion0 (HashMap k a)

newtype Union f Source

The `Monoid` `(union,empty)`

Constructors

 Union FieldsgetUnion :: f

Instances

 Functor Union Foldable Union Traversable Union Traversable1 Union Foldable1 Union HasUnion f => Reducer f (Union f) Eq f => Eq (Union f) Ord f => Ord (Union f) Read f => Read (Union f) Show f => Show (Union f) HasUnion0 f => Monoid (Union f) HasUnion f => Semigroup (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

Methods

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

Instances

 HasUnionWith IntMap Ord k => HasUnionWith (Map k)

class HasUnionWith f => HasUnionWith0 f where Source

Methods

emptyWith :: f a Source

Instances

 HasUnionWith0 IntMap Ord k => HasUnionWith0 (Map k)

newtype UnionWith f m Source

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

Constructors

 UnionWith FieldsgetUnionWith :: f m

Instances

 (HasUnionWith f, Semigroup m, Monoid m) => Reducer (f m) (UnionWith f m) (HasUnionWith0 f, Monoid m) => Monoid (UnionWith f m) (HasUnionWith f, Semigroup m) => Semigroup (UnionWith f m)