A binary operation that obeys the associative law.
A binary operation that obeys the associative law.
See the main documentation for this trait for more detail.
The identity element.
The identity element.
Passing the identity element, z
, to combine
along with any other value, a
, of type A
will result in the same value, a
. See the main documentation for this trait for more detail.
Typeclass trait representing a binary operation that obeys the associative law and an identity element that obeys the left and right identity laws.
The associative law states that given values
a
,b
, andc
of typeA
(and implicitMonoid.adapters
imported):The left identity law states that given the identity value,
z
, and any other value,a
, of typeA
(and implicitMonoid.adapters
imported):An similarly, the right identity law states that given the same values and implicit: