edu.rice.cs.plt.lambda
Class LambdaUtil

java.lang.Object
  extended by edu.rice.cs.plt.lambda.LambdaUtil

public final class LambdaUtil
extends Object

A collection of constants and static methods that define or operate on lambdas, runnables, and predicates. Since most of these operations apply to lambdas of arbitrary arity, they are defined here in groups with similar or identical names, but slightly different types. These groups include:

Other operations and constants are simple enough that they can be defined at once for all arities. The interfaces LambdaUtil.GeneralRunnable, LambdaUtil.GeneralLambda, and LambdaUtil.GeneralPredicate are defined to facilitate such definitions.

Most classes instantiated by these methods are serializable. However, since the classes generally wrap other objects, those objects must be serializable in order for serialization to succeed.


Nested Class Summary
static interface LambdaUtil.GeneralLambda<R>
          An object that functions as a lambda for all arities.
static interface LambdaUtil.GeneralPredicate
          An object that functions as a predicate for all arities.
static interface LambdaUtil.GeneralRunnable
          An object that functions as a runnable for all arities.
static interface LambdaUtil.LiftedLambda<T,R>
          A Lambda that accepts and produces Option values.
static interface LambdaUtil.LiftedLambda2<T1,T2,R>
          A Lambda2 that accepts and produces Option values.
static interface LambdaUtil.LiftedLambda3<T1,T2,T3,R>
          A Lambda3 that accepts and produces Option values.
static interface LambdaUtil.LiftedLambda4<T1,T2,T3,T4,R>
          A Lambda4 that accepts and produces Option values.
 
Field Summary
static Lambda2<Integer,Integer,Integer> ADD_INT
          Add two integers.
static Lambda<Integer,Integer> DECREMENT_INT
          Decrements an integer.
static Lambda2<Integer,Integer,Integer> DIVIDE_INT
          Divide two integers.
static Predicate2<Object,Object> EQUAL
          A predicate that evaluates to RecurUtil.safeEquals(Object, Object) applied to the arguments.
static LambdaUtil.GeneralPredicate FALSE
          A predicate whose result is always false.
static Lambda<Object,Integer> HASH_CODE
          Calls RecurUtil.safeHashCode(Object) on the input.
static Predicate2<Object,Object> IDENTICAL
          A predicate that returns true iff arg1 == arg2.
static Lambda<Integer,Integer> INCREMENT_INT
          Increments an integer.
static Predicate2<Object,Class<?>> INSTANCE_OF
          A predicate that returns true iff the first argument is an instance of the second argument.
static Predicate<Object> IS_NULL
          A predicate that returns true iff the argument is null.
static Lambda2<Integer,Integer,Integer> MULTIPLY_INT
          Multiply two integers.
static LambdaUtil.GeneralRunnable NO_OP
          A runnable that does nothing.
static Predicate2<Object,Object> NOT_EQUAL
          A predicate that evaluates to the opposite of RecurUtil.safeEquals(Object, Object) applied to the arguments.
static Predicate2<Object,Object> NOT_IDENTICAL
          A predicate that returns true iff arg1 != arg2.
static Predicate<Object> NOT_NULL
          A predicate that returns true iff the argument is not null.
static Lambda2<Object,Object,String> STRING_CONCAT
          Concatenate the result of RecurUtil.safeToString(Object) from both inputs.
static Lambda2<Integer,Integer,Integer> SUBTRACT_INT
          Subtract two integers.
static Lambda<Object,String> TO_STRING
          Calls RecurUtil.safeToString(Object) on the input.
static LambdaUtil.GeneralPredicate TRUE
          A predicate whose result is always true.
 
Method Summary
static Condition and(Condition c1, Condition c2)
          Produce the conjunction (&&) of c1 and c2.
static Condition and(Condition c1, Condition c2, Condition c3)
          Produce the conjunction (&&) of c1, c2, and c3.
static
<T> Predicate<T>
and(Iterable<? extends Predicate<? super T>> preds)
          Produce the conjunction (&&) of the given predicates.
static
<T> Predicate<T>
and(Predicate<? super T> p1, Predicate<? super T> p2)
          Produce the conjunction (&&) of p1 and p2.
static
<T> Predicate<T>
and(Predicate<? super T> p1, Predicate<? super T> p2, Predicate<? super T> p3)
          Produce the conjunction (&&) of p1, p2, and p3.
static
<T1,T2> Predicate2<T1,T2>
and(Predicate2<? super T1,? super T2> p1, Predicate2<? super T1,? super T2> p2)
          Produce the conjunction (&&) of p1 and p2.
static
<T1,T2> Predicate2<T1,T2>
and(Predicate2<? super T1,? super T2> p1, Predicate2<? super T1,? super T2> p2, Predicate2<? super T1,? super T2> p3)
          Produce the conjunction (&&) of p1, p2, and p3.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
and(Predicate3<? super T1,? super T2,? super T3> p1, Predicate3<? super T1,? super T2,? super T3> p2)
          Produce the conjunction (&&) of p1 and p2.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
and(Predicate3<? super T1,? super T2,? super T3> p1, Predicate3<? super T1,? super T2,? super T3> p2, Predicate3<? super T1,? super T2,? super T3> p3)
          Produce the conjunction (&&) of p1, p2, and p3.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1, Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
          Produce the conjunction (&&) of p1 and p2.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1, Predicate4<? super T1,? super T2,? super T3,? super T4> p2, Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
          Produce the conjunction (&&) of p1, p2, and p3.
static Condition and0(Iterable<? extends Condition> conds)
          Produce the conjunction (&&) of the given conditions.
static
<T1,T2> Predicate2<T1,T2>
and2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
          Produce the conjunction (&&) of the given predicates.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
and3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
          Produce the conjunction (&&) of the given predicates.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
and4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
          Produce the conjunction (&&) of the given predicates.
static
<T,R> Lambda2<Lambda<? super T,? extends R>,T,R>
applicationLambda()
          Create a lambda that applies its first argument to its second argument.
static Condition asCondition(Thunk<? extends Boolean> thunk)
          Create a condition based on an input that acts as a condition but is not typed as one.
static
<T> Lambda<T,Boolean>
asLambda(Predicate<? super T> predicate)
          Create a Boolean lambda based on a predicate.
static
<T1,T2> Lambda2<T1,T2,Boolean>
asLambda(Predicate2<? super T1,? super T2> predicate)
          Create a Boolean lambda based on a predicate.
static
<T1,T2,T3> Lambda3<T1,T2,T3,Boolean>
asLambda(Predicate3<? super T1,? super T2,? super T3> predicate)
          Create a Boolean lambda based on a predicate.
static
<T1,T2,T3,T4>
Lambda4<T1,T2,T3,T4,Boolean>
asLambda(Predicate4<? super T1,? super T2,? super T3,? super T4> predicate)
          Create a Boolean lambda based on a predicate.
static
<T> Lambda<T,Void>
asLambda(Runnable1<? super T> r)
          Create a lambda that executes the given runnable, then returns null.
static
<T,R> Lambda<T,R>
asLambda(Runnable1<? super T> r, R result)
          Create a lambda that executes the given runnable, then returns result.
static
<T1,T2> Lambda2<T1,T2,Void>
asLambda(Runnable2<? super T1,? super T2> r)
          Create a lambda that executes the given runnable, then returns null.
static
<T1,T2,R> Lambda2<T1,T2,R>
asLambda(Runnable2<? super T1,? super T2> r, R result)
          Create a lambda that executes the given runnable, then returns result.
static
<T1,T2,T3> Lambda3<T1,T2,T3,Void>
asLambda(Runnable3<? super T1,? super T2,? super T3> r)
          Create a lambda that executes the given runnable, then returns null.
static
<T1,T2,T3,R>
Lambda3<T1,T2,T3,R>
asLambda(Runnable3<? super T1,? super T2,? super T3> r, R result)
          Create a lambda that executes the given runnable, then returns result.
static
<T1,T2,T3,T4>
Lambda4<T1,T2,T3,T4,Void>
asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r)
          Create a lambda that executes the given runnable, then returns null.
static
<T1,T2,T3,T4,R>
Lambda4<T1,T2,T3,T4,R>
asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r, R result)
          Create a lambda that executes the given runnable, then returns result.
static
<T> Predicate<T>
asPredicate(Lambda<? super T,? extends Boolean> lambda)
          Create a predicate based on an input that acts as a predicate but is not typed as one.
static
<T1,T2> Predicate2<T1,T2>
asPredicate(Lambda2<? super T1,? super T2,? extends Boolean> lambda)
          Create a predicate based on an input that acts as a predicate but is not typed as one.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
asPredicate(Lambda3<? super T1,? super T2,? super T3,? extends Boolean> lambda)
          Create a predicate based on an input that acts as a predicate but is not typed as one.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
asPredicate(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends Boolean> lambda)
          Create a predicate based on an input that acts as a predicate but is not typed as one.
static
<T> Runnable1<T>
asRunnable(Lambda<? super T,?> lambda)
          Create a runnable that executes the given lambda (ignoring the result).
static
<T1,T2> Runnable2<T1,T2>
asRunnable(Lambda2<? super T1,? super T2,?> lambda)
          Create a runnable that executes the given lambda (ignoring the result).
static
<T1,T2,T3> Runnable3<T1,T2,T3>
asRunnable(Lambda3<? super T1,? super T2,? super T3,?> lambda)
          Create a runnable that executes the given lambda (ignoring the result).
static
<T1,T2,T3,T4>
Runnable4<T1,T2,T3,T4>
asRunnable(Lambda4<? super T1,? super T2,? super T3,? super T4,?> lambda)
          Create a runnable that executes the given lambda (ignoring the result).
static Runnable asRunnable(Thunk<?> thunk)
          Create a runnable that executes the given thunk (ignoring the result).
static Thunk<Boolean> asThunk(Condition cond)
          Create a Boolean thunk based on a condition.
static Thunk<Void> asThunk(Runnable r)
          Create a thunk that executes the given runnable, then returns null.
static
<R> Thunk<R>
asThunk(Runnable r, R result)
          Create a thunk that executes the given runnable, then returns result.
static
<T1,T2,R> Lambda3<Lambda2<? super T1,? super T2,? extends R>,T1,T2,R>
binaryApplicationLambda()
          Create a lambda that applies its first argument to its second argument.
static
<T,R> Thunk<R>
bindFirst(Lambda<? super T,? extends R> lambda, T arg)
          Bind a fixed argument to the given lambda, producing a thunk.
static
<T1,T2,R> Lambda<T2,R>
bindFirst(Lambda2<? super T1,? super T2,? extends R> lambda, T1 arg1)
          Bind a fixed argument to the given binary lambda, producing a unary lambda.
static
<T1,T2,T3,R>
Lambda2<T2,T3,R>
bindFirst(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda, T1 arg1)
          Bind a fixed argument to the given ternary lambda, producing a binary lambda.
static
<T1,T2,T3,T4,R>
Lambda3<T2,T3,T4,R>
bindFirst(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda, T1 arg1)
          Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.
static
<T> Condition
bindFirst(Predicate<? super T> pred, T arg)
          Bind a fixed argument to the given predicate, producing a condition.
static
<T1,T2> Predicate<T2>
bindFirst(Predicate2<? super T1,? super T2> pred, T1 arg1)
          Bind a fixed argument to the given binary predicate, producing a unary prediate.
static
<T1,T2,T3> Predicate2<T2,T3>
bindFirst(Predicate3<? super T1,? super T2,? super T3> pred, T1 arg1)
          Bind a fixed argument to the given ternary predicate, producing a binary predicate.
static
<T1,T2,T3,T4>
Predicate3<T2,T3,T4>
bindFirst(Predicate4<? super T1,? super T2,? super T3,? super T4> pred, T1 arg1)
          Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.
static
<T> Runnable
bindFirst(Runnable1<? super T> runnable, T arg)
          Bind a fixed argument to the given unary runnable, producing nullary runnable.
static
<T1,T2> Runnable1<T2>
bindFirst(Runnable2<? super T1,? super T2> runnable, T1 arg1)
          Bind a fixed argument to the given binary runnable, producing a unary runnable.
static
<T1,T2,T3> Runnable2<T2,T3>
bindFirst(Runnable3<? super T1,? super T2,? super T3> runnable, T1 arg1)
          Bind a fixed argument to the given ternary runnable, producing a binary runnable.
static
<T1,T2,T3,T4>
Runnable3<T2,T3,T4>
bindFirst(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable, T1 arg1)
          Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.
static
<T1,T2,T3,T4,R>
Lambda3<T1,T2,T3,R>
bindFourth(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda, T4 arg4)
          Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.
static
<T1,T2,T3,T4>
Predicate3<T1,T2,T3>
bindFourth(Predicate4<? super T1,? super T2,? super T3,? super T4> pred, T4 arg4)
          Bind a fixed argument to the given quaternary pred, producing a ternary pred.
static
<T1,T2,T3,T4>
Runnable3<T1,T2,T3>
bindFourth(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable, T4 arg4)
          Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.
static
<T1,T2,R> Lambda<T1,R>
bindSecond(Lambda2<? super T1,? super T2,? extends R> lambda, T2 arg2)
          Bind a fixed argument to the given binary lambda, producing a unary lambda.
static
<T1,T2,T3,R>
Lambda2<T1,T3,R>
bindSecond(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda, T2 arg2)
          Bind a fixed argument to the given ternary lambda, producing a binary lambda.
static
<T1,T2,T3,T4,R>
Lambda3<T1,T3,T4,R>
bindSecond(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda, T2 arg2)
          Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.
static
<T1,T2> Predicate<T1>
bindSecond(Predicate2<? super T1,? super T2> pred, T2 arg2)
          Bind a fixed argument to the given binary predicate, producing a unary predicate.
static
<T1,T2,T3> Predicate2<T1,T3>
bindSecond(Predicate3<? super T1,? super T2,? super T3> pred, T2 arg2)
          Bind a fixed argument to the given ternary predicate, producing a binary predicate.
static
<T1,T2,T3,T4>
Predicate3<T1,T3,T4>
bindSecond(Predicate4<? super T1,? super T2,? super T3,? super T4> pred, T2 arg2)
          Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.
static
<T1,T2> Runnable1<T1>
bindSecond(Runnable2<? super T1,? super T2> runnable, T2 arg2)
          Bind a fixed argument to the given binary runnable, producing a unary runnable.
static
<T1,T2,T3> Runnable2<T1,T3>
bindSecond(Runnable3<? super T1,? super T2,? super T3> runnable, T2 arg2)
          Bind a fixed argument to the given ternary runnable, producing a binary runnable.
static
<T1,T2,T3,T4>
Runnable3<T1,T3,T4>
bindSecond(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable, T2 arg2)
          Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.
static
<T1,T2,T3,R>
Lambda2<T1,T2,R>
bindThird(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda, T3 arg3)
          Bind a fixed argument to the given ternary lambda, producing a binary lambda.
static
<T1,T2,T3,T4,R>
Lambda3<T1,T2,T4,R>
bindThird(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda, T3 arg3)
          Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.
static
<T1,T2,T3> Predicate2<T1,T2>
bindThird(Predicate3<? super T1,? super T2,? super T3> pred, T3 arg3)
          Bind a fixed argument to the given ternary predicate, producing a binary predicate.
static
<T1,T2,T3,T4>
Predicate3<T1,T2,T4>
bindThird(Predicate4<? super T1,? super T2,? super T3,? super T4> pred, T3 arg3)
          Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.
static
<T1,T2,T3> Runnable2<T1,T2>
bindThird(Runnable3<? super T1,? super T2,? super T3> runnable, T3 arg3)
          Bind a fixed argument to the given ternary runnable, producing a binary runnable.
static
<T1,T2,T3,T4>
Runnable3<T1,T2,T4>
bindThird(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable, T3 arg3)
          Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.
static Runnable compose(Iterable<? extends Runnable> runnables)
          Create a runnable that executes the given runnables in sequence.
static
<S,T,U> Lambda<S,U>
compose(Lambda<? super S,? extends T> l1, Lambda<? super T,? extends U> l2)
          Create a lambda that executes l2 with the result of l1.
static
<S1,S2,T,U>
Lambda2<S1,S2,U>
compose(Lambda2<? super S1,? super S2,? extends T> l1, Lambda<? super T,? extends U> l2)
          Create a lambda that executes l2 with the result of l1.
static
<S1,S2,S3,T,U>
Lambda3<S1,S2,S3,U>
compose(Lambda3<? super S1,? super S2,? super S3,? extends T> l1, Lambda<? super T,? extends U> l2)
          Create a lambda that executes l2 with the result of l1.
static
<S1,S2,S3,S4,T,U>
Lambda4<S1,S2,S3,S4,U>
compose(Lambda4<? super S1,? super S2,? super S3,? super S4,? extends T> l1, Lambda<? super T,? extends U> l2)
          Create a lambda that executes l2 with the result of l1.
static Runnable compose(Runnable... runnables)
          Create a runnable that executes the given runnables in sequence.
static
<T> Runnable1<T>
compose(Runnable1<? super T> r1, Runnable1<? super T> r2)
          Create a runnable that executes r1 followed by r2 with the same input.
static
<T> Runnable1<T>
compose(Runnable1<? super T> r1, Runnable1<? super T> r2, Runnable1<? super T> r3)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2> Runnable2<T1,T2>
compose(Runnable2<? super T1,? super T2> r1, Runnable2<? super T1,? super T2> r2)
          Create a runnable that executes r1 followed by r2 with the same input.
static
<T1,T2> Runnable2<T1,T2>
compose(Runnable2<? super T1,? super T2> r1, Runnable2<? super T1,? super T2> r2, Runnable2<? super T1,? super T2> r3)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2,T3> Runnable3<T1,T2,T3>
compose(Runnable3<? super T1,? super T2,? super T3> r1, Runnable3<? super T1,? super T2,? super T3> r2)
          Create a runnable that executes r1 followed by r2 with the same input.
static
<T1,T2,T3> Runnable3<T1,T2,T3>
compose(Runnable3<? super T1,? super T2,? super T3> r1, Runnable3<? super T1,? super T2,? super T3> r2, Runnable3<? super T1,? super T2,? super T3> r3)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2,T3,T4>
Runnable4<T1,T2,T3,T4>
compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1, Runnable4<? super T1,? super T2,? super T3,? super T4> r2)
          Create a runnable that executes r1 followed by r2 with the same input.
static
<T1,T2,T3,T4>
Runnable4<T1,T2,T3,T4>
compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1, Runnable4<? super T1,? super T2,? super T3,? super T4> r2, Runnable4<? super T1,? super T2,? super T3,? super T4> r3)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T,U> Thunk<U>
compose(Thunk<? extends T> thunk, Lambda<? super T,? extends U> lambda)
          Create a thunk that executes lambda with the result of thunk.
static
<T> Runnable1<T>
compose1(Iterable<? extends Runnable1<? super T>> runnables)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2> Runnable2<T1,T2>
compose2(Iterable<? extends Runnable2<? super T1,? super T2>> runnables)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2,T3> Runnable3<T1,T2,T3>
compose3(Iterable<? extends Runnable3<? super T1,? super T2,? super T3>> runnables)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2,T3,T4>
Runnable4<T1,T2,T3,T4>
compose4(Iterable<? extends Runnable4<? super T1,? super T2,? super T3,? super T4>> runnables)
          Create a runnable that executes the given runnables in sequence with the same input.
static
<T1,T2,R> Lambda<T1,Lambda<T2,R>>
curry(Lambda2<? super T1,? super T2,? extends R> lambda)
          Create a curried version of the input, which accepts a single argument and returns a lambda on the second argument.
static
<T1,T2,T3,R>
Lambda<T1,Lambda<T2,Lambda<T3,R>>>
curry(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
          Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments.
static
<T1,T2,T3,T4,R>
Lambda<T1,Lambda<T2,Lambda<T3,Lambda<T4,R>>>>
curry(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
          Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments.
static
<T> LambdaUtil.GeneralLambda<T>
exceptionLambda(RuntimeException e)
          Create a lambda that always throws the given exception.
static
<T,R> Thunk<R>
flatten0(Lambda<? super Null<T>,? extends R> lambda)
          Treat a lambda accepting a 0-tuple argument as a Thunk.
static
<T> Condition
flatten0(Predicate<? super Null<T>> pred)
          Treat a predicate accepting a 0-tuple argument as a Condition.
static
<T> Runnable
flatten0(Runnable1<? super Null<T>> runnable)
          Treat a runnable accepting a 0-tuple argument as a Runnable.
static
<T1,T2,R> Lambda2<T1,T2,R>
flatten2(Lambda<? super Pair<T1,T2>,? extends R> lambda)
          Treat a lambda accepting a Pair argument as a Lambda2.
static
<T1,T2> Predicate2<T1,T2>
flatten2(Predicate<? super Pair<T1,T2>> pred)
          Treat a predicate accepting a Pair argument as a Predicate2.
static
<T1,T2> Runnable2<T1,T2>
flatten2(Runnable1<? super Pair<T1,T2>> runnable)
          Treat a runnable accepting a Pair argument as a Runnable2.
static
<T1,T2,T3,R>
Lambda3<T1,T2,T3,R>
flatten3(Lambda<? super Triple<T1,T2,T3>,? extends R> lambda)
          Treat a lambda accepting a Triple argument as a Lambda3.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
flatten3(Predicate<? super Triple<T1,T2,T3>> pred)
          Treat a predicate accepting a Triple argument as a Predicate3.
static
<T1,T2,T3> Runnable3<T1,T2,T3>
flatten3(Runnable1<? super Triple<T1,T2,T3>> runnable)
          Treat a runnable accepting a Triple argument as a Runnable3.
static
<T1,T2,T3,T4,R>
Lambda4<T1,T2,T3,T4,R>
flatten4(Lambda<? super Quad<T1,T2,T3,T4>,? extends R> lambda)
          Treat a lambda accepting a Quad argument as a Lambda4.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
flatten4(Predicate<? super Quad<T1,T2,T3,T4>> pred)
          Treat a predicate accepting a Quad argument as a Predicate4.
static
<T1,T2,T3,T4>
Runnable4<T1,T2,T3,T4>
flatten4(Runnable1<? super Quad<T1,T2,T3,T4>> runnable)
          Treat a runnable accepting a Quad argument as a Runnable4.
static
<T> Lambda<T,T>
identity()
          Create the identity lambda for the type T.
static
<T,R> LambdaUtil.LiftedLambda<T,R>
lift(Lambda<? super T,? extends R> lambda)
          Lift a Lambda to accept an option value, returning Option.none() in the "none" case.
static
<T1,T2,R> LambdaUtil.LiftedLambda2<T1,T2,R>
lift(Lambda2<? super T1,? super T2,? extends R> lambda)
          Lift a Lambda2 to accept option values, returning Option.none() if any argument is "none".
static
<T1,T2,T3,R>
LambdaUtil.LiftedLambda3<T1,T2,T3,R>
lift(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
          Lift a Lambda3 to accept option values, returning Option.none() if any argument is "none".
static
<T1,T2,T3,T4,R>
LambdaUtil.LiftedLambda4<T1,T2,T3,T4,R>
lift(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
          Lift a Lambda4 to accept option values, returning Option.none() if any argument is "none".
static Condition negate(Condition cond)
          Produce the negation (!) of cond.
static
<T> Predicate<T>
negate(Predicate<? super T> pred)
          Produce the negation (!) of pred.
static
<T1,T2> Predicate2<T1,T2>
negate(Predicate2<? super T1,? super T2> pred)
          Produce the negation (!) of pred.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
negate(Predicate3<? super T1,? super T2,? super T3> pred)
          Produce the negation (!) of pred.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
negate(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
          Produce the negation (!) of pred.
static
<T> LambdaUtil.GeneralLambda<T>
nullLambda()
          Create a lambda whose result is always null.
static Condition or(Condition c1, Condition c2)
          Produce the disjunction (||) of c1 and c2.
static Condition or(Condition c1, Condition c2, Condition c3)
          Produce the disjunction (||) of c1, c2, and c3.
static
<T> Predicate<T>
or(Iterable<? extends Predicate<? super T>> preds)
          Produce the disjunction (||) of the given predicates.
static
<T> Predicate<T>
or(Predicate<? super T> p1, Predicate<? super T> p2)
          Produce the disjunction (||) of p1 and p2.
static
<T> Predicate<T>
or(Predicate<? super T> p1, Predicate<? super T> p2, Predicate<? super T> p3)
          Produce the disjunction (||) of p1, p2, and p3.
static
<T1,T2> Predicate2<T1,T2>
or(Predicate2<? super T1,? super T2> p1, Predicate2<? super T1,? super T2> p2)
          Produce the disjunction (||) of p1 and p2.
static
<T1,T2> Predicate2<T1,T2>
or(Predicate2<? super T1,? super T2> p1, Predicate2<? super T1,? super T2> p2, Predicate2<? super T1,? super T2> p3)
          Produce the disjunction (||) of p1, p2, and p3.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
or(Predicate3<? super T1,? super T2,? super T3> p1, Predicate3<? super T1,? super T2,? super T3> p2)
          Produce the disjunction (||) of p1 and p2.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
or(Predicate3<? super T1,? super T2,? super T3> p1, Predicate3<? super T1,? super T2,? super T3> p2, Predicate3<? super T1,? super T2,? super T3> p3)
          Produce the disjunction (||) of p1, p2, and p3.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1, Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
          Produce the disjunction (||) of p1 and p2.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1, Predicate4<? super T1,? super T2,? super T3,? super T4> p2, Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
          Produce the disjunction (||) of p1, p2, and p3.
static Condition or0(Iterable<? extends Condition> conds)
          Produce the disjunction (||) of the given conditions.
static
<T1,T2> Predicate2<T1,T2>
or2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
          Produce the conjunction (||) of the given predicates.
static
<T1,T2,T3> Predicate3<T1,T2,T3>
or3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
          Produce the conjunction (||) of the given predicates.
static
<T1,T2,T3,T4>
Predicate4<T1,T2,T3,T4>
or4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
          Produce the conjunction (||) of the given predicates.
static LambdaUtil.GeneralPredicate promote(Condition cond)
          Create a GeneralPredicate equivalent to cond that ignores any arguments.
static
<T,R> Lambda2<T,Object,R>
promote(Lambda<? super T,? extends R> lambda)
          Create a Lambda2 equivalent to lambda with an additional, ignored argument.
static
<T1,T2,R> Lambda3<T1,T2,Object,R>
promote(Lambda2<? super T1,? super T2,? extends R> lambda)
          Create a Lambda3 equivalent to lambda with an additional, ignored argument.
static
<T1,T2,T3,R>
Lambda4<T1,T2,T3,Object,R>
promote(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
          Create a Lambda4 equivalent to lambda with an additional, ignored argument.
static
<T> Predicate2<T,Object>
promote(Predicate<? super T> pred)
          Create a Predicate2 equivalent to pred with an additional, ignored argument.
static
<T1,T2> Predicate3<T1,T2,Object>
promote(Predicate2<? super T1,? super T2> pred)
          Create a Predicate3 equivalent to pred with an additional, ignored argument.
static
<T1,T2,T3> Predicate4<T1,T2,T3,Object>
promote(Predicate3<? super T1,? super T2,? super T3> pred)
          Create a Predicate4 equivalent to pred with an additional, ignored argument.
static LambdaUtil.GeneralRunnable promote(Runnable r)
          Create a GeneralRunnable equivalent to r that ignores any arguments.
static
<T> Runnable2<T,Object>
promote(Runnable1<? super T> r)
          Create a Runnable2 equivalent to r with an additional, ignored argument.
static
<T1,T2> Runnable3<T1,T2,Object>
promote(Runnable2<? super T1,? super T2> r)
          Create a Runnable3 equivalent to r with an additional, ignored argument.
static
<T1,T2,T3> Runnable4<T1,T2,T3,Object>
promote(Runnable3<? super T1,? super T2,? super T3> r)
          Create a Runnable4 equivalent to r with an additional, ignored argument.
static
<R> LambdaUtil.GeneralLambda<R>
promote(Thunk<? extends R> thunk)
          Create a GeneralLambda equivalent to thunk that ignores any arguments.
static
<T1,T2,T3,R>
Lambda4<Lambda3<? super T1,? super T2,? super T3,? extends R>,T1,T2,T3,R>
ternaryApplicationLambda()
          Create a lambda that applies its first argument to its second argument.
static
<R> Lambda<Thunk<? extends R>,R>
thunkValueLambda()
          Create a lambda that applies its first argument to its second argument.
static
<T1,T2,R> Lambda2<T2,T1,R>
transpose(Lambda2<? super T1,? super T2,? extends R> lambda)
          Swap the order of a binary lambda's arguments.
static
<T1,T2> Predicate2<T2,T1>
transpose(Predicate2<? super T1,? super T2> pred)
          Swap the order of a binary predicate's arguments.
static
<T1,T2> Runnable2<T2,T1>
transpose(Runnable2<? super T1,? super T2> r)
          Swap the order of a binary runnable's arguments.
static Predicate<Null<?>> unary(Condition cond)
          Treat a Condition as a unary predicate accepting a 0-tuple argument.
static
<T1,T2,R> Lambda<Pair<T1,T2>,R>
unary(Lambda2<? super T1,? super T2,? extends R> lambda)
          Treat a Lambda2 as a unary lambda accepting a Pair argument.
static
<T1,T2,T3,R>
Lambda<Triple<T1,T2,T3>,R>
unary(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
          Treat a Lambda3 as a unary lambda accepting a Triple argument.
static
<T1,T2,T3,T4,R>
Lambda<Quad<T1,T2,T3,T4>,R>
unary(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
          Treat a Lambda4 as a unary lambda accepting a Quad argument.
static
<T1,T2> Predicate<Pair<T1,T2>>
unary(Predicate2<? super T1,? super T2> pred)
          Treat a Predicate2 as a unary predicate accepting a Pair argument.
static
<T1,T2,T3> Predicate<Triple<T1,T2,T3>>
unary(Predicate3<? super T1,? super T2,? super T3> pred)
          Treat a Predicate3 as a unary predicate accepting a Triple argument.
static
<T1,T2,T3,T4>
Predicate<Quad<T1,T2,T3,T4>>
unary(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
          Treat a Predicate4 as a unary predicate accepting a Quad argument.
static Runnable1<Null<?>> unary(Runnable runnable)
          Treat a Runnable as a Runnable1 accepting a 0-tuple argument.
static
<T1,T2> Runnable1<Pair<T1,T2>>
unary(Runnable2<? super T1,? super T2> runnable)
          Treat a Runnable2 as a Runnable1 accepting a Pair argument.
static
<T1,T2,T3> Runnable1<Triple<T1,T2,T3>>
unary(Runnable3<? super T1,? super T2,? super T3> runnable)
          Treat a Runnable3 as a Runnable1 accepting a Triple argument.
static
<T1,T2,T3,T4>
Runnable1<Quad<T1,T2,T3,T4>>
unary(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable)
          Treat a Runnable4 as a Runnable1 accepting a Quad argument.
static
<R> Lambda<Null<?>,R>
unary(Thunk<? extends R> thunk)
          Treat a Thunk as a unary lambda accepting a 0-tuple argument.
static
<T> LambdaUtil.GeneralLambda<T>
valueLambda(T val)
          Create a lambda whose result is always val.
static
<T,R> Lambda<T,Option<R>>
wrapPartial(Lambda<? super T,? extends R> lambda, boolean filterNull, Predicate<? super RuntimeException> filterException)
          Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none".
static
<T1,T2,R> Lambda2<T1,T2,Option<R>>
wrapPartial(Lambda2<? super T1,? super T2,? extends R> lambda, boolean filterNull, Predicate<? super RuntimeException> filterException)
          Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none".
static
<T1,T2,T3,R>
Lambda3<T1,T2,T3,Option<R>>
wrapPartial(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda, boolean filterNull, Predicate<? super RuntimeException> filterException)
          Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none".
static
<T1,T2,T3,T4,R>
Lambda4<T1,T2,T3,T4,Option<R>>
wrapPartial(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda, boolean filterNull, Predicate<? super RuntimeException> filterException)
          Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none".
static
<R> Thunk<Option<R>>
wrapPartial(Thunk<? extends R> thunk, boolean filterNull, Predicate<? super RuntimeException> filterException)
          Treat the given thunk as a partial function, where well-defined results have a "some" return type, and undefined results map to "none".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_OP

public static final LambdaUtil.GeneralRunnable NO_OP
A runnable that does nothing.


TRUE

public static final LambdaUtil.GeneralPredicate TRUE
A predicate whose result is always true.


FALSE

public static final LambdaUtil.GeneralPredicate FALSE
A predicate whose result is always false.


IS_NULL

public static final Predicate<Object> IS_NULL
A predicate that returns true iff the argument is null.


NOT_NULL

public static final Predicate<Object> NOT_NULL
A predicate that returns true iff the argument is not null.


EQUAL

public static final Predicate2<Object,Object> EQUAL
A predicate that evaluates to RecurUtil.safeEquals(Object, Object) applied to the arguments.


NOT_EQUAL

public static final Predicate2<Object,Object> NOT_EQUAL
A predicate that evaluates to the opposite of RecurUtil.safeEquals(Object, Object) applied to the arguments.


IDENTICAL

public static final Predicate2<Object,Object> IDENTICAL
A predicate that returns true iff arg1 == arg2.


NOT_IDENTICAL

public static final Predicate2<Object,Object> NOT_IDENTICAL
A predicate that returns true iff arg1 != arg2.


INSTANCE_OF

public static final Predicate2<Object,Class<?>> INSTANCE_OF
A predicate that returns true iff the first argument is an instance of the second argument.


TO_STRING

public static final Lambda<Object,String> TO_STRING
Calls RecurUtil.safeToString(Object) on the input.


STRING_CONCAT

public static final Lambda2<Object,Object,String> STRING_CONCAT
Concatenate the result of RecurUtil.safeToString(Object) from both inputs.


HASH_CODE

public static final Lambda<Object,Integer> HASH_CODE
Calls RecurUtil.safeHashCode(Object) on the input.


INCREMENT_INT

public static final Lambda<Integer,Integer> INCREMENT_INT
Increments an integer.


DECREMENT_INT

public static final Lambda<Integer,Integer> DECREMENT_INT
Decrements an integer.


ADD_INT

public static final Lambda2<Integer,Integer,Integer> ADD_INT
Add two integers.


SUBTRACT_INT

public static final Lambda2<Integer,Integer,Integer> SUBTRACT_INT
Subtract two integers.


MULTIPLY_INT

public static final Lambda2<Integer,Integer,Integer> MULTIPLY_INT
Multiply two integers.


DIVIDE_INT

public static final Lambda2<Integer,Integer,Integer> DIVIDE_INT
Divide two integers.

Method Detail

identity

public static <T> Lambda<T,T> identity()
Create the identity lambda for the type T.


nullLambda

public static <T> LambdaUtil.GeneralLambda<T> nullLambda()
Create a lambda whose result is always null.


exceptionLambda

public static <T> LambdaUtil.GeneralLambda<T> exceptionLambda(RuntimeException e)
Create a lambda that always throws the given exception. The stack trace will be filled in each time value() is invoked.


valueLambda

public static <T> LambdaUtil.GeneralLambda<T> valueLambda(T val)
Create a lambda whose result is always val.


thunkValueLambda

public static <R> Lambda<Thunk<? extends R>,R> thunkValueLambda()
Create a lambda that applies its first argument to its second argument.


applicationLambda

public static <T,R> Lambda2<Lambda<? super T,? extends R>,T,R> applicationLambda()
Create a lambda that applies its first argument to its second argument.


binaryApplicationLambda

public static <T1,T2,R> Lambda3<Lambda2<? super T1,? super T2,? extends R>,T1,T2,R> binaryApplicationLambda()
Create a lambda that applies its first argument to its second argument.


ternaryApplicationLambda

public static <T1,T2,T3,R> Lambda4<Lambda3<? super T1,? super T2,? super T3,? extends R>,T1,T2,T3,R> ternaryApplicationLambda()
Create a lambda that applies its first argument to its second argument.


promote

public static LambdaUtil.GeneralRunnable promote(Runnable r)
Create a GeneralRunnable equivalent to r that ignores any arguments.


promote

public static <T> Runnable2<T,Object> promote(Runnable1<? super T> r)
Create a Runnable2 equivalent to r with an additional, ignored argument.


promote

public static <T1,T2> Runnable3<T1,T2,Object> promote(Runnable2<? super T1,? super T2> r)
Create a Runnable3 equivalent to r with an additional, ignored argument.


promote

public static <T1,T2,T3> Runnable4<T1,T2,T3,Object> promote(Runnable3<? super T1,? super T2,? super T3> r)
Create a Runnable4 equivalent to r with an additional, ignored argument.


promote

public static <R> LambdaUtil.GeneralLambda<R> promote(Thunk<? extends R> thunk)
Create a GeneralLambda equivalent to thunk that ignores any arguments.


promote

public static <T,R> Lambda2<T,Object,R> promote(Lambda<? super T,? extends R> lambda)
Create a Lambda2 equivalent to lambda with an additional, ignored argument.


promote

public static <T1,T2,R> Lambda3<T1,T2,Object,R> promote(Lambda2<? super T1,? super T2,? extends R> lambda)
Create a Lambda3 equivalent to lambda with an additional, ignored argument.


promote

public static <T1,T2,T3,R> Lambda4<T1,T2,T3,Object,R> promote(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Create a Lambda4 equivalent to lambda with an additional, ignored argument.


promote

public static LambdaUtil.GeneralPredicate promote(Condition cond)
Create a GeneralPredicate equivalent to cond that ignores any arguments.


promote

public static <T> Predicate2<T,Object> promote(Predicate<? super T> pred)
Create a Predicate2 equivalent to pred with an additional, ignored argument.


promote

public static <T1,T2> Predicate3<T1,T2,Object> promote(Predicate2<? super T1,? super T2> pred)
Create a Predicate3 equivalent to pred with an additional, ignored argument.


promote

public static <T1,T2,T3> Predicate4<T1,T2,T3,Object> promote(Predicate3<? super T1,? super T2,? super T3> pred)
Create a Predicate4 equivalent to pred with an additional, ignored argument.


compose

public static <T,U> Thunk<U> compose(Thunk<? extends T> thunk,
                                     Lambda<? super T,? extends U> lambda)
Create a thunk that executes lambda with the result of thunk.


compose

public static <S,T,U> Lambda<S,U> compose(Lambda<? super S,? extends T> l1,
                                          Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1.


compose

public static <S1,S2,T,U> Lambda2<S1,S2,U> compose(Lambda2<? super S1,? super S2,? extends T> l1,
                                                   Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1.


compose

public static <S1,S2,S3,T,U> Lambda3<S1,S2,S3,U> compose(Lambda3<? super S1,? super S2,? super S3,? extends T> l1,
                                                         Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1.


compose

public static <S1,S2,S3,S4,T,U> Lambda4<S1,S2,S3,S4,U> compose(Lambda4<? super S1,? super S2,? super S3,? super S4,? extends T> l1,
                                                               Lambda<? super T,? extends U> l2)
Create a lambda that executes l2 with the result of l1.


compose

public static Runnable compose(Runnable... runnables)
Create a runnable that executes the given runnables in sequence.


compose

public static Runnable compose(Iterable<? extends Runnable> runnables)
Create a runnable that executes the given runnables in sequence.


compose

public static <T> Runnable1<T> compose(Runnable1<? super T> r1,
                                       Runnable1<? super T> r2)
Create a runnable that executes r1 followed by r2 with the same input.


compose

public static <T> Runnable1<T> compose(Runnable1<? super T> r1,
                                       Runnable1<? super T> r2,
                                       Runnable1<? super T> r3)
Create a runnable that executes the given runnables in sequence with the same input.


compose1

public static <T> Runnable1<T> compose1(Iterable<? extends Runnable1<? super T>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. The name compose1 is used to avoid a name clash with compose(Iterable) (due to erasure).


compose

public static <T1,T2> Runnable2<T1,T2> compose(Runnable2<? super T1,? super T2> r1,
                                               Runnable2<? super T1,? super T2> r2)
Create a runnable that executes r1 followed by r2 with the same input.


compose

public static <T1,T2> Runnable2<T1,T2> compose(Runnable2<? super T1,? super T2> r1,
                                               Runnable2<? super T1,? super T2> r2,
                                               Runnable2<? super T1,? super T2> r3)
Create a runnable that executes the given runnables in sequence with the same input.


compose2

public static <T1,T2> Runnable2<T1,T2> compose2(Iterable<? extends Runnable2<? super T1,? super T2>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. The name compose2 is used to avoid a name clash with compose(Iterable) (due to erasure).


compose

public static <T1,T2,T3> Runnable3<T1,T2,T3> compose(Runnable3<? super T1,? super T2,? super T3> r1,
                                                     Runnable3<? super T1,? super T2,? super T3> r2)
Create a runnable that executes r1 followed by r2 with the same input.


compose

public static <T1,T2,T3> Runnable3<T1,T2,T3> compose(Runnable3<? super T1,? super T2,? super T3> r1,
                                                     Runnable3<? super T1,? super T2,? super T3> r2,
                                                     Runnable3<? super T1,? super T2,? super T3> r3)
Create a runnable that executes the given runnables in sequence with the same input.


compose3

public static <T1,T2,T3> Runnable3<T1,T2,T3> compose3(Iterable<? extends Runnable3<? super T1,? super T2,? super T3>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. The name compose3 is used to avoid a name clash with compose(Iterable) (due to erasure).


compose

public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
                                                           Runnable4<? super T1,? super T2,? super T3,? super T4> r2)
Create a runnable that executes r1 followed by r2 with the same input.


compose

public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose(Runnable4<? super T1,? super T2,? super T3,? super T4> r1,
                                                           Runnable4<? super T1,? super T2,? super T3,? super T4> r2,
                                                           Runnable4<? super T1,? super T2,? super T3,? super T4> r3)
Create a runnable that executes the given runnables in sequence with the same input.


compose4

public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> compose4(Iterable<? extends Runnable4<? super T1,? super T2,? super T3,? super T4>> runnables)
Create a runnable that executes the given runnables in sequence with the same input. The name compose4 is used to avoid a name clash with compose(Iterable) (due to erasure).


bindFirst

public static <T,R> Thunk<R> bindFirst(Lambda<? super T,? extends R> lambda,
                                       T arg)
Bind a fixed argument to the given lambda, producing a thunk.


bindFirst

public static <T1,T2,R> Lambda<T2,R> bindFirst(Lambda2<? super T1,? super T2,? extends R> lambda,
                                               T1 arg1)
Bind a fixed argument to the given binary lambda, producing a unary lambda.


bindSecond

public static <T1,T2,R> Lambda<T1,R> bindSecond(Lambda2<? super T1,? super T2,? extends R> lambda,
                                                T2 arg2)
Bind a fixed argument to the given binary lambda, producing a unary lambda.


bindFirst

public static <T1,T2,T3,R> Lambda2<T2,T3,R> bindFirst(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
                                                      T1 arg1)
Bind a fixed argument to the given ternary lambda, producing a binary lambda.


bindSecond

public static <T1,T2,T3,R> Lambda2<T1,T3,R> bindSecond(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
                                                       T2 arg2)
Bind a fixed argument to the given ternary lambda, producing a binary lambda.


bindThird

public static <T1,T2,T3,R> Lambda2<T1,T2,R> bindThird(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
                                                      T3 arg3)
Bind a fixed argument to the given ternary lambda, producing a binary lambda.


bindFirst

public static <T1,T2,T3,T4,R> Lambda3<T2,T3,T4,R> bindFirst(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
                                                            T1 arg1)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.


bindSecond

public static <T1,T2,T3,T4,R> Lambda3<T1,T3,T4,R> bindSecond(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
                                                             T2 arg2)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.


bindThird

public static <T1,T2,T3,T4,R> Lambda3<T1,T2,T4,R> bindThird(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
                                                            T3 arg3)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.


bindFourth

public static <T1,T2,T3,T4,R> Lambda3<T1,T2,T3,R> bindFourth(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
                                                             T4 arg4)
Bind a fixed argument to the given quaternary lambda, producing a ternary lambda.


bindFirst

public static <T> Condition bindFirst(Predicate<? super T> pred,
                                      T arg)
Bind a fixed argument to the given predicate, producing a condition.


bindFirst

public static <T1,T2> Predicate<T2> bindFirst(Predicate2<? super T1,? super T2> pred,
                                              T1 arg1)
Bind a fixed argument to the given binary predicate, producing a unary prediate.


bindSecond

public static <T1,T2> Predicate<T1> bindSecond(Predicate2<? super T1,? super T2> pred,
                                               T2 arg2)
Bind a fixed argument to the given binary predicate, producing a unary predicate.


bindFirst

public static <T1,T2,T3> Predicate2<T2,T3> bindFirst(Predicate3<? super T1,? super T2,? super T3> pred,
                                                     T1 arg1)
Bind a fixed argument to the given ternary predicate, producing a binary predicate.


bindSecond

public static <T1,T2,T3> Predicate2<T1,T3> bindSecond(Predicate3<? super T1,? super T2,? super T3> pred,
                                                      T2 arg2)
Bind a fixed argument to the given ternary predicate, producing a binary predicate.


bindThird

public static <T1,T2,T3> Predicate2<T1,T2> bindThird(Predicate3<? super T1,? super T2,? super T3> pred,
                                                     T3 arg3)
Bind a fixed argument to the given ternary predicate, producing a binary predicate.


bindFirst

public static <T1,T2,T3,T4> Predicate3<T2,T3,T4> bindFirst(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
                                                           T1 arg1)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.


bindSecond

public static <T1,T2,T3,T4> Predicate3<T1,T3,T4> bindSecond(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
                                                            T2 arg2)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.


bindThird

public static <T1,T2,T3,T4> Predicate3<T1,T2,T4> bindThird(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
                                                           T3 arg3)
Bind a fixed argument to the given quaternary predicate, producing a ternary predicate.


bindFourth

public static <T1,T2,T3,T4> Predicate3<T1,T2,T3> bindFourth(Predicate4<? super T1,? super T2,? super T3,? super T4> pred,
                                                            T4 arg4)
Bind a fixed argument to the given quaternary pred, producing a ternary pred.


bindFirst

public static <T> Runnable bindFirst(Runnable1<? super T> runnable,
                                     T arg)
Bind a fixed argument to the given unary runnable, producing nullary runnable.


bindFirst

public static <T1,T2> Runnable1<T2> bindFirst(Runnable2<? super T1,? super T2> runnable,
                                              T1 arg1)
Bind a fixed argument to the given binary runnable, producing a unary runnable.


bindSecond

public static <T1,T2> Runnable1<T1> bindSecond(Runnable2<? super T1,? super T2> runnable,
                                               T2 arg2)
Bind a fixed argument to the given binary runnable, producing a unary runnable.


bindFirst

public static <T1,T2,T3> Runnable2<T2,T3> bindFirst(Runnable3<? super T1,? super T2,? super T3> runnable,
                                                    T1 arg1)
Bind a fixed argument to the given ternary runnable, producing a binary runnable.


bindSecond

public static <T1,T2,T3> Runnable2<T1,T3> bindSecond(Runnable3<? super T1,? super T2,? super T3> runnable,
                                                     T2 arg2)
Bind a fixed argument to the given ternary runnable, producing a binary runnable.


bindThird

public static <T1,T2,T3> Runnable2<T1,T2> bindThird(Runnable3<? super T1,? super T2,? super T3> runnable,
                                                    T3 arg3)
Bind a fixed argument to the given ternary runnable, producing a binary runnable.


bindFirst

public static <T1,T2,T3,T4> Runnable3<T2,T3,T4> bindFirst(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
                                                          T1 arg1)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.


bindSecond

public static <T1,T2,T3,T4> Runnable3<T1,T3,T4> bindSecond(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
                                                           T2 arg2)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.


bindThird

public static <T1,T2,T3,T4> Runnable3<T1,T2,T4> bindThird(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
                                                          T3 arg3)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.


bindFourth

public static <T1,T2,T3,T4> Runnable3<T1,T2,T3> bindFourth(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable,
                                                           T4 arg4)
Bind a fixed argument to the given quaternary runnable, producing a ternary runnable.


curry

public static <T1,T2,R> Lambda<T1,Lambda<T2,R>> curry(Lambda2<? super T1,? super T2,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a lambda on the second argument.


curry

public static <T1,T2,T3,R> Lambda<T1,Lambda<T2,Lambda<T3,R>>> curry(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments.


curry

public static <T1,T2,T3,T4,R> Lambda<T1,Lambda<T2,Lambda<T3,Lambda<T4,R>>>> curry(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Create a curried version of the input, which accepts a single argument and returns a curried lambda on the other arguments.


transpose

public static <T1,T2,R> Lambda2<T2,T1,R> transpose(Lambda2<? super T1,? super T2,? extends R> lambda)
Swap the order of a binary lambda's arguments.


transpose

public static <T1,T2> Predicate2<T2,T1> transpose(Predicate2<? super T1,? super T2> pred)
Swap the order of a binary predicate's arguments.


transpose

public static <T1,T2> Runnable2<T2,T1> transpose(Runnable2<? super T1,? super T2> r)
Swap the order of a binary runnable's arguments.


flatten0

public static <T,R> Thunk<R> flatten0(Lambda<? super Null<T>,? extends R> lambda)
Treat a lambda accepting a 0-tuple argument as a Thunk.


flatten2

public static <T1,T2,R> Lambda2<T1,T2,R> flatten2(Lambda<? super Pair<T1,T2>,? extends R> lambda)
Treat a lambda accepting a Pair argument as a Lambda2.


flatten3

public static <T1,T2,T3,R> Lambda3<T1,T2,T3,R> flatten3(Lambda<? super Triple<T1,T2,T3>,? extends R> lambda)
Treat a lambda accepting a Triple argument as a Lambda3.


flatten4

public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,R> flatten4(Lambda<? super Quad<T1,T2,T3,T4>,? extends R> lambda)
Treat a lambda accepting a Quad argument as a Lambda4.


flatten0

public static <T> Condition flatten0(Predicate<? super Null<T>> pred)
Treat a predicate accepting a 0-tuple argument as a Condition.


flatten2

public static <T1,T2> Predicate2<T1,T2> flatten2(Predicate<? super Pair<T1,T2>> pred)
Treat a predicate accepting a Pair argument as a Predicate2.


flatten3

public static <T1,T2,T3> Predicate3<T1,T2,T3> flatten3(Predicate<? super Triple<T1,T2,T3>> pred)
Treat a predicate accepting a Triple argument as a Predicate3.


flatten4

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> flatten4(Predicate<? super Quad<T1,T2,T3,T4>> pred)
Treat a predicate accepting a Quad argument as a Predicate4.


flatten0

public static <T> Runnable flatten0(Runnable1<? super Null<T>> runnable)
Treat a runnable accepting a 0-tuple argument as a Runnable.


flatten2

public static <T1,T2> Runnable2<T1,T2> flatten2(Runnable1<? super Pair<T1,T2>> runnable)
Treat a runnable accepting a Pair argument as a Runnable2.


flatten3

public static <T1,T2,T3> Runnable3<T1,T2,T3> flatten3(Runnable1<? super Triple<T1,T2,T3>> runnable)
Treat a runnable accepting a Triple argument as a Runnable3.


flatten4

public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> flatten4(Runnable1<? super Quad<T1,T2,T3,T4>> runnable)
Treat a runnable accepting a Quad argument as a Runnable4.


unary

public static <R> Lambda<Null<?>,R> unary(Thunk<? extends R> thunk)
Treat a Thunk as a unary lambda accepting a 0-tuple argument.


unary

public static <T1,T2,R> Lambda<Pair<T1,T2>,R> unary(Lambda2<? super T1,? super T2,? extends R> lambda)
Treat a Lambda2 as a unary lambda accepting a Pair argument.


unary

public static <T1,T2,T3,R> Lambda<Triple<T1,T2,T3>,R> unary(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Treat a Lambda3 as a unary lambda accepting a Triple argument.


unary

public static <T1,T2,T3,T4,R> Lambda<Quad<T1,T2,T3,T4>,R> unary(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Treat a Lambda4 as a unary lambda accepting a Quad argument.


unary

public static Predicate<Null<?>> unary(Condition cond)
Treat a Condition as a unary predicate accepting a 0-tuple argument.


unary

public static <T1,T2> Predicate<Pair<T1,T2>> unary(Predicate2<? super T1,? super T2> pred)
Treat a Predicate2 as a unary predicate accepting a Pair argument.


unary

public static <T1,T2,T3> Predicate<Triple<T1,T2,T3>> unary(Predicate3<? super T1,? super T2,? super T3> pred)
Treat a Predicate3 as a unary predicate accepting a Triple argument.


unary

public static <T1,T2,T3,T4> Predicate<Quad<T1,T2,T3,T4>> unary(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
Treat a Predicate4 as a unary predicate accepting a Quad argument.


unary

public static Runnable1<Null<?>> unary(Runnable runnable)
Treat a Runnable as a Runnable1 accepting a 0-tuple argument.


unary

public static <T1,T2> Runnable1<Pair<T1,T2>> unary(Runnable2<? super T1,? super T2> runnable)
Treat a Runnable2 as a Runnable1 accepting a Pair argument.


unary

public static <T1,T2,T3> Runnable1<Triple<T1,T2,T3>> unary(Runnable3<? super T1,? super T2,? super T3> runnable)
Treat a Runnable3 as a Runnable1 accepting a Triple argument.


unary

public static <T1,T2,T3,T4> Runnable1<Quad<T1,T2,T3,T4>> unary(Runnable4<? super T1,? super T2,? super T3,? super T4> runnable)
Treat a Runnable4 as a Runnable1 accepting a Quad argument.


wrapPartial

public static <R> Thunk<Option<R>> wrapPartial(Thunk<? extends R> thunk,
                                               boolean filterNull,
                                               Predicate<? super RuntimeException> filterException)
Treat the given thunk as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". The provided thunk is considered to be "undefined" if it returns null and filterNull is true, or if it throws a RuntimeException that is accepted by filterException.


wrapPartial

public static <T,R> Lambda<T,Option<R>> wrapPartial(Lambda<? super T,? extends R> lambda,
                                                    boolean filterNull,
                                                    Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". The provided lambda is considered to be "undefined" for some argument if it returns null and filterNull is true, or if it throws a RuntimeException that is accepted by filterException.


wrapPartial

public static <T1,T2,R> Lambda2<T1,T2,Option<R>> wrapPartial(Lambda2<? super T1,? super T2,? extends R> lambda,
                                                             boolean filterNull,
                                                             Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". The provided lambda is considered to be "undefined" for some set of arguments if it returns null and filterNull is true, or if it throws a RuntimeException that is accepted by filterException.


wrapPartial

public static <T1,T2,T3,R> Lambda3<T1,T2,T3,Option<R>> wrapPartial(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda,
                                                                   boolean filterNull,
                                                                   Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". The provided lambda is considered to be "undefined" for some set of arguments if it returns null and filterNull is true, or if it throws a RuntimeException that is accepted by filterException.


wrapPartial

public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,Option<R>> wrapPartial(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda,
                                                                         boolean filterNull,
                                                                         Predicate<? super RuntimeException> filterException)
Treat the given lambda as a partial function, where well-defined results have a "some" return type, and undefined results map to "none". The provided lambda is considered to be "undefined" for some set of arguments if it returns null and filterNull is true, or if it throws a RuntimeException that is accepted by filterException.


lift

public static <T,R> LambdaUtil.LiftedLambda<T,R> lift(Lambda<? super T,? extends R> lambda)
Lift a Lambda to accept an option value, returning Option.none() in the "none" case.


lift

public static <T1,T2,R> LambdaUtil.LiftedLambda2<T1,T2,R> lift(Lambda2<? super T1,? super T2,? extends R> lambda)
Lift a Lambda2 to accept option values, returning Option.none() if any argument is "none".


lift

public static <T1,T2,T3,R> LambdaUtil.LiftedLambda3<T1,T2,T3,R> lift(Lambda3<? super T1,? super T2,? super T3,? extends R> lambda)
Lift a Lambda3 to accept option values, returning Option.none() if any argument is "none".


lift

public static <T1,T2,T3,T4,R> LambdaUtil.LiftedLambda4<T1,T2,T3,T4,R> lift(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends R> lambda)
Lift a Lambda4 to accept option values, returning Option.none() if any argument is "none".


negate

public static Condition negate(Condition cond)
Produce the negation (!) of cond.


negate

public static <T> Predicate<T> negate(Predicate<? super T> pred)
Produce the negation (!) of pred.


negate

public static <T1,T2> Predicate2<T1,T2> negate(Predicate2<? super T1,? super T2> pred)
Produce the negation (!) of pred.


negate

public static <T1,T2,T3> Predicate3<T1,T2,T3> negate(Predicate3<? super T1,? super T2,? super T3> pred)
Produce the negation (!) of pred.


negate

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> negate(Predicate4<? super T1,? super T2,? super T3,? super T4> pred)
Produce the negation (!) of pred.


and

public static Condition and(Condition c1,
                            Condition c2)
Produce the conjunction (&&) of c1 and c2.


and

public static Condition and(Condition c1,
                            Condition c2,
                            Condition c3)
Produce the conjunction (&&) of c1, c2, and c3.


and0

public static Condition and0(Iterable<? extends Condition> conds)
Produce the conjunction (&&) of the given conditions.


and

public static <T> Predicate<T> and(Predicate<? super T> p1,
                                   Predicate<? super T> p2)
Produce the conjunction (&&) of p1 and p2.


and

public static <T> Predicate<T> and(Predicate<? super T> p1,
                                   Predicate<? super T> p2,
                                   Predicate<? super T> p3)
Produce the conjunction (&&) of p1, p2, and p3.


and

public static <T> Predicate<T> and(Iterable<? extends Predicate<? super T>> preds)
Produce the conjunction (&&) of the given predicates.


and

public static <T1,T2> Predicate2<T1,T2> and(Predicate2<? super T1,? super T2> p1,
                                            Predicate2<? super T1,? super T2> p2)
Produce the conjunction (&&) of p1 and p2.


and

public static <T1,T2> Predicate2<T1,T2> and(Predicate2<? super T1,? super T2> p1,
                                            Predicate2<? super T1,? super T2> p2,
                                            Predicate2<? super T1,? super T2> p3)
Produce the conjunction (&&) of p1, p2, and p3.


and2

public static <T1,T2> Predicate2<T1,T2> and2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
Produce the conjunction (&&) of the given predicates. The name and2 is used to avoid a name clash with and(Iterable) (due to erasure).


and

public static <T1,T2,T3> Predicate3<T1,T2,T3> and(Predicate3<? super T1,? super T2,? super T3> p1,
                                                  Predicate3<? super T1,? super T2,? super T3> p2)
Produce the conjunction (&&) of p1 and p2.


and

public static <T1,T2,T3> Predicate3<T1,T2,T3> and(Predicate3<? super T1,? super T2,? super T3> p1,
                                                  Predicate3<? super T1,? super T2,? super T3> p2,
                                                  Predicate3<? super T1,? super T2,? super T3> p3)
Produce the conjunction (&&) of p1, p2, and p3.


and3

public static <T1,T2,T3> Predicate3<T1,T2,T3> and3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
Produce the conjunction (&&) of the given predicates. The name and3 is used to avoid a name clash with and(Iterable) (due to erasure).


and

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
                                                        Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
Produce the conjunction (&&) of p1 and p2.


and

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
                                                        Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
                                                        Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
Produce the conjunction (&&) of p1, p2, and p3.


and4

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> and4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
Produce the conjunction (&&) of the given predicates. The name and4 is used to avoid a name clash with and(Iterable) (due to erasure).


or

public static Condition or(Condition c1,
                           Condition c2)
Produce the disjunction (||) of c1 and c2.


or

public static Condition or(Condition c1,
                           Condition c2,
                           Condition c3)
Produce the disjunction (||) of c1, c2, and c3.


or0

public static Condition or0(Iterable<? extends Condition> conds)
Produce the disjunction (||) of the given conditions.


or

public static <T> Predicate<T> or(Predicate<? super T> p1,
                                  Predicate<? super T> p2)
Produce the disjunction (||) of p1 and p2.


or

public static <T> Predicate<T> or(Predicate<? super T> p1,
                                  Predicate<? super T> p2,
                                  Predicate<? super T> p3)
Produce the disjunction (||) of p1, p2, and p3.


or

public static <T> Predicate<T> or(Iterable<? extends Predicate<? super T>> preds)
Produce the disjunction (||) of the given predicates.


or

public static <T1,T2> Predicate2<T1,T2> or(Predicate2<? super T1,? super T2> p1,
                                           Predicate2<? super T1,? super T2> p2)
Produce the disjunction (||) of p1 and p2.


or

public static <T1,T2> Predicate2<T1,T2> or(Predicate2<? super T1,? super T2> p1,
                                           Predicate2<? super T1,? super T2> p2,
                                           Predicate2<? super T1,? super T2> p3)
Produce the disjunction (||) of p1, p2, and p3.


or2

public static <T1,T2> Predicate2<T1,T2> or2(Iterable<? extends Predicate2<? super T1,? super T2>> preds)
Produce the conjunction (||) of the given predicates. The name or2 is used to avoid a name clash with or(Iterable) (due to erasure).


or

public static <T1,T2,T3> Predicate3<T1,T2,T3> or(Predicate3<? super T1,? super T2,? super T3> p1,
                                                 Predicate3<? super T1,? super T2,? super T3> p2)
Produce the disjunction (||) of p1 and p2.


or

public static <T1,T2,T3> Predicate3<T1,T2,T3> or(Predicate3<? super T1,? super T2,? super T3> p1,
                                                 Predicate3<? super T1,? super T2,? super T3> p2,
                                                 Predicate3<? super T1,? super T2,? super T3> p3)
Produce the disjunction (||) of p1, p2, and p3.


or3

public static <T1,T2,T3> Predicate3<T1,T2,T3> or3(Iterable<? extends Predicate3<? super T1,? super T2,? super T3>> preds)
Produce the conjunction (||) of the given predicates. The name or3 is used to avoid a name clash with or(Iterable) (due to erasure).


or

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
                                                       Predicate4<? super T1,? super T2,? super T3,? super T4> p2)
Produce the disjunction (||) of p1 and p2.


or

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or(Predicate4<? super T1,? super T2,? super T3,? super T4> p1,
                                                       Predicate4<? super T1,? super T2,? super T3,? super T4> p2,
                                                       Predicate4<? super T1,? super T2,? super T3,? super T4> p3)
Produce the disjunction (||) of p1, p2, and p3.


or4

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> or4(Iterable<? extends Predicate4<? super T1,? super T2,? super T3,? super T4>> preds)
Produce the conjunction (||) of the given predicates. The name or4 is used to avoid a name clash with or(Iterable) (due to erasure).


asRunnable

public static Runnable asRunnable(Thunk<?> thunk)
Create a runnable that executes the given thunk (ignoring the result).


asRunnable

public static <T> Runnable1<T> asRunnable(Lambda<? super T,?> lambda)
Create a runnable that executes the given lambda (ignoring the result).


asRunnable

public static <T1,T2> Runnable2<T1,T2> asRunnable(Lambda2<? super T1,? super T2,?> lambda)
Create a runnable that executes the given lambda (ignoring the result).


asRunnable

public static <T1,T2,T3> Runnable3<T1,T2,T3> asRunnable(Lambda3<? super T1,? super T2,? super T3,?> lambda)
Create a runnable that executes the given lambda (ignoring the result).


asRunnable

public static <T1,T2,T3,T4> Runnable4<T1,T2,T3,T4> asRunnable(Lambda4<? super T1,? super T2,? super T3,? super T4,?> lambda)
Create a runnable that executes the given lambda (ignoring the result).


asThunk

public static Thunk<Void> asThunk(Runnable r)
Create a thunk that executes the given runnable, then returns null.


asThunk

public static <R> Thunk<R> asThunk(Runnable r,
                                   R result)
Create a thunk that executes the given runnable, then returns result.


asLambda

public static <T> Lambda<T,Void> asLambda(Runnable1<? super T> r)
Create a lambda that executes the given runnable, then returns null.


asLambda

public static <T,R> Lambda<T,R> asLambda(Runnable1<? super T> r,
                                         R result)
Create a lambda that executes the given runnable, then returns result.


asLambda

public static <T1,T2> Lambda2<T1,T2,Void> asLambda(Runnable2<? super T1,? super T2> r)
Create a lambda that executes the given runnable, then returns null.


asLambda

public static <T1,T2,R> Lambda2<T1,T2,R> asLambda(Runnable2<? super T1,? super T2> r,
                                                  R result)
Create a lambda that executes the given runnable, then returns result.


asLambda

public static <T1,T2,T3> Lambda3<T1,T2,T3,Void> asLambda(Runnable3<? super T1,? super T2,? super T3> r)
Create a lambda that executes the given runnable, then returns null.


asLambda

public static <T1,T2,T3,R> Lambda3<T1,T2,T3,R> asLambda(Runnable3<? super T1,? super T2,? super T3> r,
                                                        R result)
Create a lambda that executes the given runnable, then returns result.


asLambda

public static <T1,T2,T3,T4> Lambda4<T1,T2,T3,T4,Void> asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r)
Create a lambda that executes the given runnable, then returns null.


asLambda

public static <T1,T2,T3,T4,R> Lambda4<T1,T2,T3,T4,R> asLambda(Runnable4<? super T1,? super T2,? super T3,? super T4> r,
                                                              R result)
Create a lambda that executes the given runnable, then returns result.


asCondition

public static Condition asCondition(Thunk<? extends Boolean> thunk)
Create a condition based on an input that acts as a condition but is not typed as one.


asPredicate

public static <T> Predicate<T> asPredicate(Lambda<? super T,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one.


asPredicate

public static <T1,T2> Predicate2<T1,T2> asPredicate(Lambda2<? super T1,? super T2,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one.


asPredicate

public static <T1,T2,T3> Predicate3<T1,T2,T3> asPredicate(Lambda3<? super T1,? super T2,? super T3,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one.


asPredicate

public static <T1,T2,T3,T4> Predicate4<T1,T2,T3,T4> asPredicate(Lambda4<? super T1,? super T2,? super T3,? super T4,? extends Boolean> lambda)
Create a predicate based on an input that acts as a predicate but is not typed as one.


asThunk

public static Thunk<Boolean> asThunk(Condition cond)
Create a Boolean thunk based on a condition.


asLambda

public static <T> Lambda<T,Boolean> asLambda(Predicate<? super T> predicate)
Create a Boolean lambda based on a predicate.


asLambda

public static <T1,T2> Lambda2<T1,T2,Boolean> asLambda(Predicate2<? super T1,? super T2> predicate)
Create a Boolean lambda based on a predicate.


asLambda

public static <T1,T2,T3> Lambda3<T1,T2,T3,Boolean> asLambda(Predicate3<? super T1,? super T2,? super T3> predicate)
Create a Boolean lambda based on a predicate.


asLambda

public static <T1,T2,T3,T4> Lambda4<T1,T2,T3,T4,Boolean> asLambda(Predicate4<? super T1,? super T2,? super T3,? super T4> predicate)
Create a Boolean lambda based on a predicate.