cyclops.typeclasses.Combine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cyclops-pure Show documentation
Show all versions of cyclops-pure Show documentation
Platform for Functional Reactive Programming with Java 8
The newest version!
package cyclops.typeclasses;
import java.util.function.BinaryOperator;
import java.util.stream.Stream;
import com.oath.cyclops.hkt.Higher;
public interface Combine {
default Higher plus(Higher identity, BinaryOperator> accumulator, Higher... tocombine){
return Stream.of(tocombine)
.reduce(identity, accumulator);
}
default Higher plus(Higher identity, BinaryOperator> accumulator, Stream> tocombine){
return tocombine.reduce(identity, accumulator);
}
}