Class Times<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn3.Times<A>
-
- Type Parameters:
A
- the input and output type
- All Implemented Interfaces:
Fn1<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>>
,Fn2<java.lang.Integer,Fn1<? super A,? extends A>,Fn1<A,A>>
,Fn3<java.lang.Integer,Fn1<? super A,? extends A>,A,A>
,Applicative<Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
,Cartesian<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<?,?>>
,Cocartesian<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<?,?>>
,Contravariant<java.lang.Integer,Profunctor<?,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<?,?>>>
,Functor<Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
,Profunctor<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<?,?>>
,Monad<Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
,MonadReader<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
,MonadRec<Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
,MonadWriter<java.lang.Integer,Fn1<Fn1<? super A,? extends A>,Fn1<A,A>>,Fn1<java.lang.Integer,?>>
public final class Times<A> extends java.lang.Object implements Fn3<java.lang.Integer,Fn1<? super A,? extends A>,A,A>
Given some number of timesn
to invoke a functionA -> A
, and given an inputA
, iteratively apply the function to the input, and then to the result of the invocation, a total ofn
times, returning the result.Example:
times(3, x -> x + 1, 0); // 3
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Times()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description A
checkedApply(java.lang.Integer n, Fn1<? super A,? extends A> fn, A a)
static <A> Times<A>
times()
static <A> Fn2<Fn1<? super A,? extends A>,A,A>
times(java.lang.Integer n)
static <A> Fn1<A,A>
times(java.lang.Integer n, Fn1<? super A,? extends A> fn)
static <A> A
times(java.lang.Integer n, Fn1<? super A,? extends A> fn, A a)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
checkedApply, toBiFunction
-
-
-
-
Field Detail
-
INSTANCE
private static final Times<?> INSTANCE
-
-