arrow-typeclasses / arrow.typeclasses / Monoid

Monoid

interface Monoid<A> : Semigroup<A>, MonoidOf<A>

Functions

combineAll open fun Collection<A>.combineAll(): A
Combine an Collection of A values.open fun combineAll(elems: List<A>): A
Combine an array of A values.
empty abstract fun empty(): A
A zero value for this A

Inherited Functions

combine abstract fun A.combine(b: A): A
Combine two A values.
maybeCombine open fun A.maybeCombine(b: A?): A
plus open operator fun A.plus(b: A): A

Extension Functions

ap fun <A, T, U> ConstOf<A, T>.ap(SG: Semigroup<A>, ff: ConstOf<A, (T) -> U>): Const<A, U>
biunnest fun <F, G, A, B> BinestedType<F, G, A, B>.biunnest(): BiunnestedType<F, G, A, B>
combine fun <A, T> ConstOf<A, T>.combine(SG: Semigroup<A>, that: ConstOf<A, T>): Const<A, T>
conest fun <F, A, B> CounnestedType<F, A, B>.conest(): ConestedType<F, A, B>
counnest fun <F, A, B> ConestedType<F, A, B>.counnest(): CounnestedType<F, A, B>
nest fun <F, G, A> UnnestedType<F, G, A>.nest(): NestedType<F, G, A>
unnest fun <F, G, A> NestedType<F, G, A>.unnest(): UnnestedType<F, G, A>
value fun <A, T> ConstOf<A, T>.value(): A

Inheritors

Semiring interface Semiring<A> : Monoid<A>

Type Class Hierarchy