public static <A, B> F<Callable<A>, Callable<B>> fmap(final F<A, B> f) {
return new F<Callable<A>, Callable<B>>() {
public Callable<B> f(final Callable<A> a) {
return bind(a, new F<A, Callable<B>>() {
public Callable<B> f(final A ab) {
return new Callable<B>() {
public B call() {
return f.f(ab);
}
};
}
});
}
};
}
ใครธาตุแข็งแรงเชิญไปอ่านได้ที่นี่
Higher-Order Java Parallelism, Part 1: Parallel Strategies and the Callable Monad