Monoid

interface Monoid<A, Self : Monoid<A, Self>> : Semigroup<A, Self> (source)

A Semigroup with an identity element.

Laws:

  • Left identity: op(mzero(), a) == a

  • Right identity: op(a, mzero()) == a

See also

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun mzero(): Self

The identity element of op.

Link copied to clipboard
abstract fun op(a: Self, b: Self): Self

Combines a and b; the receiver is only used to select the instance.