1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/// Trait for associative binary operations with an identity element.
///
/// The trait requires that the following property holds:
/// ```ignore
/// // The operation * is associative.
/// (a * b) * c == a * (b * c)
///
/// // There exists an identity element.
/// a * id == id * a == a
/// ```
/// This property cannot be checked by the compiler so the implementer should verify it by themself.
/// Trait for the relationship between two monoids in the [`LazySegTree`](crate::LazySegTree)
///
/// A lazy segment tree requires two monoids **M** and **A**, which represent _the
/// property of interval_ and _the lazy action on the range_, respectively.
///
/// **M** only need to be monoid while **A** need to satisfy both monoid and lazy action properties.
/// By implementing `LazyAct` you are confirming that the action of **A** on **M** satisfies
/// following conditions:
///
/// ```ignore
/// // The identity of `A` should map m from `M` to itself.
/// id(m) == m
///
/// // The mapping corresponds to an element of `A` should be homomorphic.
/// f(m * n) == f(m) * f(n)
/// ```