T - Data type of elements to be combined@FunctionalInterface public interface Semigroup<T> extends BinaryFn<T>, java.util.function.BinaryOperator<T>
Fn2.FunctionalOperations<T1,T2,R>| Modifier and Type | Method and Description |
|---|---|
T |
apply(T t,
T u) |
default <W,R> SemigroupK<W,R> |
toSemigroupK(Kleisli<W,T,R> widen,
Cokleisli<W,R,T> narrow)
Example
|
default <W,R> SemigroupK<W,R> toSemigroupK(Kleisli<W,T,R> widen, Cokleisli<W,R,T> narrow)
Semigroup<Maybe<Integer>> m = Semigroups.combineZippables(Semigroups.intMax);
SemigroupK<maybe, Integer> x = m.toSemigroupK(Maybe.kindKleisli(), Maybe.kindCokleisli());