fj.F2W Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionaljava Show documentation
Show all versions of functionaljava Show documentation
Functional Java is an open source library that supports closures for the Java programming language
package fj;
import fj.control.parallel.Promise;
import fj.data.*;
/**
* Created by MarkPerry on 22/01/2015.
*/
public abstract class F2W implements F2 {
/**
* Partial application.
*
* @param a The A
to which to apply this function.
* @return The function partially applied to the given argument.
*/
public final F1W f(final A a) {
return F1W.lift(F2Functions.f(this, a));
}
/**
* Curries this wrapped function to a wrapped function of arity-1 that returns another wrapped function.
*
* @return a wrapped function of arity-1 that returns another wrapped function.
*/
public final F1W> curry() {
return F1W.lift(F2Functions.curry(this));
}
/**
* Flips the arguments of this function.
*
* @return A new function with the arguments of this function flipped.
*/
public final F2W flip() {
return lift(F2Functions.flip(this));
}
/**
* Uncurries this function to a function on tuples.
*
* @return A new function that calls this function with the elements of a given tuple.
*/
public final F1W, C> tuple() {
return F1W.lift(F2Functions.tuple(this));
}
/**
* Promotes this function to a function on Arrays.
*
* @return This function promoted to transform Arrays.
*/
public final F2W, Array, Array> arrayM() {
return lift(F2Functions.arrayM(this));
}
/**
* Promotes this function to a function on Promises.
*
* @return This function promoted to transform Promises.
*/
public final F2W, Promise, Promise> promiseM() {
return lift(F2Functions.promiseM(this));
}
/**
* Promotes this function to a function on Iterables.
*
* @return This function promoted to transform Iterables.
*/
public final F2W, Iterable, IterableW> iterableM() {
return lift(F2Functions.iterableM(this));
}
/**
* Promotes this function to a function on Lists.
*
* @return This function promoted to transform Lists.
*/
public final F2W, List, List> listM() {
return lift(F2Functions.listM(this));
}
/**
* Promotes this function to a function on non-empty lists.
*
* @return This function promoted to transform non-empty lists.
*/
public final F2W, NonEmptyList, NonEmptyList> nelM() {
return lift(F2Functions.nelM(this));
}
/**
* Promotes this function to a function on Options.
*
* @return This function promoted to transform Options.
*/
public final F2W