
jedi.functors.ComposeableFunctor0 Maven / Gradle / Ivy
The newest version!
package jedi.functors;
import jedi.functional.Functor;
import jedi.functional.Functor0;
public class ComposeableFunctor0 implements Functor0 {
private final Functor0 functor;
public ComposeableFunctor0(final Functor0 functor) {
this.functor = functor;
}
/**
* Function composition: this.andThen(g) == g(this.execute())
*/
public ComposeableFunctor0 andThen(final Functor super R, NEW_R> g) {
return new ComposeableFunctor0(new Functor0() {
public NEW_R execute() {
return g.execute(functor.execute());
}
});
}
public R execute() {
return functor.execute();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy