Trait fingertrees::monoid::Monoid
source · Expand description
Monoid definition
Monoid is a tuple of (S, O, I)
where:
S
- set of elementsO
- binary operation on SS x S -> S
, here calledjoin
I
- identity element of this monoid, here calledunit
Every monoid implementation should satisfy following laws:
- associativity:
a + (b + c) == (a + b) + c
- identity element:
unit + a == a + unit == a