Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Monoid.RightAction.Coproduct
Documentation
The coproduct of two monoids is a monoid that can contain values of either constituent.
This is useful if you have two different actions on the same state type, and want to combine them.
Note: The multiplication of this monoid is formal, so the same semantic values may have differing representations.
Therefore it's not advised to inspect the contents of a coproduct.
You should usually want to use normaliseCoproduct
.
Constructors
Coproduct | |
Fields
|
Construct a coproduct value from the left constituent monoid.
Semantically, this is a monoid homomorphism: inL m1 <> inL m2
acts the same as inL (m1 <> m2).
Construct a coproduct value from the right constituent monoid.
Semantically, this is a monoid homomorphism: inR m1 <> inR m2
acts the same as inR (m1 <> m2).