com.aol.cyclops.functionaljava.FromJDK Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cyclops-functionaljava Show documentation
Show all versions of cyclops-functionaljava Show documentation
Converters and Comprehenders for FunctionalJava
package com.aol.cyclops.functionaljava;
import java.util.function.BiFunction;
import java.util.function.Function;
import fj.F2;
import fj.F;
import fj.data.Option;
public class FromJDK {
public static F f1(Function fn) {
return (t) -> fn.apply(t);
}
public static F2 f2(BiFunction fn) {
return (t, x) -> fn.apply(t, x);
}
public static Option option(java.util.Optional o) {
if (o.isPresent())
return Option.some(o.get());
return Option.none();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy