fj.F2W Maven / Gradle / Ivy
package fj;
import fj.control.parallel.Promise;
import fj.data.*;
import static fj.P.p;
import static fj.data.IterableW.wrap;
import static fj.data.Set.iterableSet;
import static fj.data.Tree.node;
import static fj.data.TreeZipper.treeZipper;
import static fj.data.Zipper.zipper;
/**
* 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 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 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 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 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 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 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 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 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 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 F2W
© 2015 - 2025 Weber Informatics LLC | Privacy Policy