reducers-3.11: 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 
Eq a => HasUnion [a] Source 
HasUnion (IntMap a) Source 
Ord a => HasUnion (Set a) Source 
(Eq a, Hashable a) => HasUnion (HashSet a) Source 
Ord k => HasUnion (Map k a) Source 
(Eq k, Hashable k) => HasUnion (HashMap k a) Source 

class HasUnion f => HasUnion0 f where Source

Methods

empty :: f Source

Instances

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

newtype Union f Source

Constructors

Union 

Fields

getUnion :: f
 

Instances

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

newtype UnionWith f m Source

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

Constructors

UnionWith 

Fields

getUnionWith :: f m
 

Instances

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