All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cyclops.typeclasses.Combine Maven / Gradle / Ivy

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy