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

com.aol.cyclops.functionaljava.FromJDK Maven / Gradle / Ivy

There is a newer version: 9.0.0-MI7
Show newest version
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