A
- The element type this Semigroup is formed over@FunctionalInterface public interface Semigroup<A> extends Fn2<A,A,A>
Semigroup
is a closed, associative category. As closure can be implied by the type signature, and
associativity is not enforceable, this is simply represented as a binary operator.Modifier and Type | Method and Description |
---|---|
default Semigroup<A> |
flip()
Flip the order of the arguments.
|
default A |
foldLeft(A a,
Iterable<A> as)
Catamorphism under this semigroup using
FoldLeft , where the binary operator is this semigroup, and the
starting accumulator is provided. |
default Lazy<A> |
foldRight(A a,
Iterable<A> as)
Catamorphism under this semigroup using
FoldRight , where the binary operator is this semigroup, and the
starting accumulator is provided. |
apply, apply, checkedApply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, fn2, fromBiFunction, toBiFunction, uncurry, widen
default A foldLeft(A a, Iterable<A> as)
FoldLeft
, where the binary operator is this semigroup, and the
starting accumulator is provided.a
- the starting accumulatoras
- the elements to fold overFoldLeft
default Lazy<A> foldRight(A a, Iterable<A> as)
FoldRight
, where the binary operator is this semigroup, and the
starting accumulator is provided.a
- the starting accumulatoras
- the elements to fold overFoldRight