|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfj.Function
public final class Function
Transformations on functions.
Method Summary | ||
---|---|---|
static
|
andThen()
Function composition flipped. |
|
static
|
andThen(F<A,B> g,
F<B,C> f)
Function composition flipped. |
|
static
|
apply(F<C,F<A,B>> cab,
F<C,A> ca)
Performs function application within a higher-order function (applicative functor pattern). |
|
static
|
bind(F<C,A> ma,
F<A,F<C,B>> f)
Binds the function in the second argument to the function in the first argument. |
|
static
|
bind(F<D,A> ca,
F<D,B> cb,
F<A,F<B,C>> f)
Binds the given function f to the values of the given functions, with a final join. |
|
static
|
compose()
Function composition. |
|
static
|
compose(F<B,C> f,
F<A,B> g)
Function composition. |
|
static
|
compose2(F<C,D> f,
F<A,F<B,C>> g)
Function composition. |
|
static
|
constant()
Returns a function that given an argument, returns a function that ignores its argument. |
|
static
|
constant(B b)
Returns a function that ignores its argument to constantly produce the given value. |
|
static
|
curry(F2<A,B,C> f)
Curry a function of arity-2. |
|
static
|
curry(F2<A,B,C> f,
A a)
Curry a function of arity-2. |
|
static
|
curry(F3<A,B,C,D> f)
Curry a function of arity-3. |
|
static
|
curry(F3<A,B,C,D> f,
A a)
Curry a function of arity-3. |
|
static
|
curry(F3<A,B,C,D> f,
A a,
B b)
Curry a function of arity-3. |
|
static
|
curry(F4<A,B,C,D,E> f)
Curry a function of arity-4. |
|
static
|
curry(F4<A,B,C,D,E> f,
A a)
Curry a function of arity-4. |
|
static
|
curry(F4<A,B,C,D,E> f,
A a,
B b)
Curry a function of arity-4. |
|
static
|
curry(F4<A,B,C,D,E> f,
A a,
B b,
C c)
Curry a function of arity-4. |
|
static
|
curry(F5<A,B,C,D,E,F$> f)
Curry a function of arity-5. |
|
static
|
curry(F5<A,B,C,D,E,F$> f,
A a)
Curry a function of arity-5. |
|
static
|
curry(F5<A,B,C,D,E,F$> f,
A a,
B b)
Curry a function of arity-5. |
|
static
|
curry(F5<A,B,C,D,E,F$> f,
A a,
B b,
C c)
Curry a function of arity-5. |
|
static
|
curry(F5<A,B,C,D,E,F$> f,
A a,
B b,
C c,
D d)
Curry a function of arity-5. |
|
static
|
curry(F6<A,B,C,D,E,F$,G> f)
Curry a function of arity-6. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a,
B b)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a,
B b,
C c)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a,
B b,
C c,
D d)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a,
B b,
C c,
D d,
E e)
Curry a function of arity-7. |
|
static
|
curry(F7<A,B,C,D,E,F$,G,H> f,
A a,
B b,
C c,
D d,
E e,
F$ f$)
Curry a function of arity-7. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b,
C c)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b,
C c,
D d)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b,
C c,
D d,
E e)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b,
C c,
D d,
E e,
F$ f$)
Curry a function of arity-8. |
|
static
|
curry(F8<A,B,C,D,E,F$,G,H,I> f,
A a,
B b,
C c,
D d,
E e,
F$ f$,
G g)
Curry a function of arity-7. |
|
static
|
flip()
Function argument flipping. |
|
static
|
flip(F<A,F<B,C>> f)
Function argument flipping. |
|
static
|
flip(F2<A,B,C> f)
Function argument flipping. |
|
static
|
flip2()
Function argument flipping. |
|
static
|
identity()
The identity transformation. |
|
static
|
join(F<B,F<B,A>> f)
Joins two arguments of a function of arity-2 into one argument, yielding a function of arity-1. |
|
static
|
lift(F<A,F<B,C>> f)
Promotes a function of arity-2 to a higher-order function. |
|
static
|
on(F<A,F<A,C>> a,
F<B,A> f)
Applies a given function over the arguments of another function of arity-2. |
|
static
|
partialApply2(F<A,F<B,C>> f,
B b)
Partial application of the second argument to the supplied function to get a function of type A -> C. |
|
static
|
partialApply3(F<A,F<B,F<C,D>>> f,
C c)
Partial application of the third argument to the supplied function to get a function of type A -> B -> D. |
|
static
|
partialApply4(F<A,F<B,F<C,F<D,E>>>> f,
D d)
Partial application of the fourth argument to the supplied function to get a function of type A -> B -> C -> E. |
|
static
|
partialApply5(F<A,F<B,F<C,F<D,F<E,F$>>>>> f,
E e)
Partial application of the fifth argument to the supplied function to get a function of type A -> B -> C -> D -> F$. |
|
static
|
partialApply6(F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>> f,
F$ f$)
Partial application of the sixth argument to the supplied function to get a function of type A -> B -> C -> D -> E -> G. |
|
static
|
partialApply7(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>> f,
G g)
Partial application of the seventh argument to the supplied function to get a function of type A -> B -> C -> D -> E -> F$ -> H. |
|
static
|
partialApply8(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>> f,
H h)
Partial application of the eigth argument to the supplied function to get a function of type A -> B -> C -> D -> E -> F$ -> G -> I. |
|
static
|
uncurryF2()
Uncurry a function of arity-2. |
|
static
|
uncurryF2(F<A,F<B,C>> f)
Uncurry a function of arity-2. |
|
static
|
uncurryF3()
Uncurry a function of arity-3. |
|
static
|
uncurryF3(F<A,F<B,F<C,D>>> f)
Uncurry a function of arity-3. |
|
static
|
uncurryF4()
Uncurry a function of arity-4. |
|
static
|
uncurryF4(F<A,F<B,F<C,F<D,E>>>> f)
Uncurry a function of arity-4. |
|
static
|
uncurryF5()
Uncurry a function of arity-5. |
|
static
|
uncurryF5(F<A,F<B,F<C,F<D,F<E,F$>>>>> f)
Uncurry a function of arity-6. |
|
static
|
uncurryF6()
Uncurry a function of arity-6. |
|
static
|
uncurryF6(F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>> f)
Uncurry a function of arity-6. |
|
static
|
uncurryF7()
Uncurry a function of arity-7. |
|
static
|
uncurryF7(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>> f)
Uncurry a function of arity-7. |
|
static
|
uncurryF8()
Uncurry a function of arity-8. |
|
static
|
uncurryF8(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>> f)
Uncurry a function of arity-8. |
|
static
|
vary()
Simultaneously covaries and contravaries a function. |
|
static
|
vary(F<? super A,? extends B> f)
Simultaneously covaries and contravaries a function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <A,B,C> F<F<B,C>,F<F<A,B>,F<A,C>>> compose()
public static <A,B,C> F<A,C> compose(F<B,C> f, F<A,B> g)
f
- A function to compose with another.g
- A function to compose with another.
public static <A,B,C,D> F<A,F<B,D>> compose2(F<C,D> f, F<A,F<B,C>> g)
f
- A function to compose with another.g
- A function to compose with another.
public static <A,B,C> F<F<A,B>,F<F<B,C>,F<A,C>>> andThen()
public static <A,B,C> F<A,C> andThen(F<A,B> g, F<B,C> f)
g
- A function to compose with another.f
- A function to compose with another.
public static <A> F<A,A> identity()
public static <A,B> F<B,F<A,B>> constant()
public static <A,B> F<A,B> constant(B b)
b
- The value to return when the returned function is applied.
public static <A,B> F<A,B> vary(F<? super A,? extends B> f)
f
- The function to vary.
public static <C,A extends C,B,D extends B> F<F<C,D>,F<A,B>> vary()
public static <A,B,C> F<F<A,F<B,C>>,F<B,F<A,C>>> flip()
public static <A,B,C> F<B,F<A,C>> flip(F<A,F<B,C>> f)
f
- The function to flip.
public static <A,B,C> F2<B,A,C> flip(F2<A,B,C> f)
f
- The function to flip.
public static <A,B,C> F<F2<A,B,C>,F2<B,A,C>> flip2()
public static <A,B,C> F<A,F<B,C>> curry(F2<A,B,C> f)
f
- The function to curry.
public static <A,B,C> F<B,C> curry(F2<A,B,C> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C> F<F<A,F<B,C>>,F2<A,B,C>> uncurryF2()
public static <A,B,C> F2<A,B,C> uncurryF2(F<A,F<B,C>> f)
f
- The function to uncurry.
public static <A,B,C,D> F<A,F<B,F<C,D>>> curry(F3<A,B,C,D> f)
f
- The function to curry.
public static <A,B,C,D> F<B,F<C,D>> curry(F3<A,B,C,D> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C,D> F<C,D> curry(F3<A,B,C,D> f, A a, B b)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.
public static <A,B,C,D> F<F<A,F<B,F<C,D>>>,F3<A,B,C,D>> uncurryF3()
public static <A,B,C,D> F3<A,B,C,D> uncurryF3(F<A,F<B,F<C,D>>> f)
f
- The function to uncurry.
public static <A,B,C,D,E> F<A,F<B,F<C,F<D,E>>>> curry(F4<A,B,C,D,E> f)
f
- The function to curry.
public static <A,B,C,D,E> F<B,F<C,F<D,E>>> curry(F4<A,B,C,D,E> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C,D,E> F<C,F<D,E>> curry(F4<A,B,C,D,E> f, A a, B b)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.
public static <A,B,C,D,E> F<D,E> curry(F4<A,B,C,D,E> f, A a, B b, C c)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.
public static <A,B,C,D,E> F<F<A,F<B,F<C,F<D,E>>>>,F4<A,B,C,D,E>> uncurryF4()
public static <A,B,C,D,E> F4<A,B,C,D,E> uncurryF4(F<A,F<B,F<C,F<D,E>>>> f)
f
- The function to uncurry.
public static <A,B,C,D,E,F$> F<A,F<B,F<C,F<D,F<E,F$>>>>> curry(F5<A,B,C,D,E,F$> f)
f
- The function to curry.
public static <A,B,C,D,E,F$> F<B,F<C,F<D,F<E,F$>>>> curry(F5<A,B,C,D,E,F$> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C,D,E,F$> F<C,F<D,F<E,F$>>> curry(F5<A,B,C,D,E,F$> f, A a, B b)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.
public static <A,B,C,D,E,F$> F<D,F<E,F$>> curry(F5<A,B,C,D,E,F$> f, A a, B b, C c)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.
public static <A,B,C,D,E,F$> F<E,F$> curry(F5<A,B,C,D,E,F$> f, A a, B b, C c, D d)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.
public static <A,B,C,D,E,F$> F<F<A,F<B,F<C,F<D,F<E,F$>>>>>,F5<A,B,C,D,E,F$>> uncurryF5()
public static <A,B,C,D,E,F$> F5<A,B,C,D,E,F$> uncurryF5(F<A,F<B,F<C,F<D,F<E,F$>>>>> f)
f
- The function to uncurry.
public static <A,B,C,D,E,F$,G> F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>> curry(F6<A,B,C,D,E,F$,G> f)
f
- The function to curry.
public static <A,B,C,D,E,F$,G> F<F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>>,F6<A,B,C,D,E,F$,G>> uncurryF6()
public static <A,B,C,D,E,F$,G> F6<A,B,C,D,E,F$,G> uncurryF6(F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>> f)
f
- The function to uncurry.
public static <A,B,C,D,E,F$,G,H> F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>> curry(F7<A,B,C,D,E,F$,G,H> f)
f
- The function to curry.
public static <A,B,C,D,E,F$,G,H> F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>> curry(F7<A,B,C,D,E,F$,G,H> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<C,F<D,F<E,F<F$,F<G,H>>>>> curry(F7<A,B,C,D,E,F$,G,H> f, A a, B b)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<D,F<E,F<F$,F<G,H>>>> curry(F7<A,B,C,D,E,F$,G,H> f, A a, B b, C c)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<E,F<F$,F<G,H>>> curry(F7<A,B,C,D,E,F$,G,H> f, A a, B b, C c, D d)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<F$,F<G,H>> curry(F7<A,B,C,D,E,F$,G,H> f, A a, B b, C c, D d, E e)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.e
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<G,H> curry(F7<A,B,C,D,E,F$,G,H> f, A a, B b, C c, D d, E e, F$ f$)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.e
- An argument to the curried function.f$
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H> F<F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>>,F7<A,B,C,D,E,F$,G,H>> uncurryF7()
public static <A,B,C,D,E,F$,G,H> F7<A,B,C,D,E,F$,G,H> uncurryF7(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>> f)
f
- The function to uncurry.
public static <A,B,C,D,E,F$,G,H,I> F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>> curry(F8<A,B,C,D,E,F$,G,H,I> f)
f
- The function to curry.
public static <A,B,C,D,E,F$,G,H,I> F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a)
f
- The function to curry.a
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<D,F<E,F<F$,F<G,F<H,I>>>>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b, C c)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<E,F<F$,F<G,F<H,I>>>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b, C c, D d)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<F$,F<G,F<H,I>>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b, C c, D d, E e)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.e
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<G,F<H,I>> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b, C c, D d, E e, F$ f$)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.e
- An argument to the curried function.f$
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<H,I> curry(F8<A,B,C,D,E,F$,G,H,I> f, A a, B b, C c, D d, E e, F$ f$, G g)
f
- The function to curry.a
- An argument to the curried function.b
- An argument to the curried function.c
- An argument to the curried function.d
- An argument to the curried function.e
- An argument to the curried function.f$
- An argument to the curried function.g
- An argument to the curried function.
public static <A,B,C,D,E,F$,G,H,I> F<F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>>,F8<A,B,C,D,E,F$,G,H,I>> uncurryF8()
public static <A,B,C,D,E,F$,G,H,I> F8<A,B,C,D,E,F$,G,H,I> uncurryF8(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>> f)
f
- The function to uncurry.
public static <A,B,C> F<C,B> bind(F<C,A> ma, F<A,F<C,B>> f)
ma
- A function whose argument type is the same as the argument type of the return value.f
- A function whose argument type is the same as the return type of ma,
and yields the return value.
public static <A,B,C> F<C,B> apply(F<C,F<A,B>> cab, F<C,A> ca)
cab
- The higher-order function to apply a function to.ca
- A function to apply within a higher-order function.
public static <A,B,C,D> F<D,C> bind(F<D,A> ca, F<D,B> cb, F<A,F<B,C>> f)
ca
- A function to bind f function to.cb
- A function to bind f function to.f
- The bound function to be composed with ca and then applied with cb
public static <A,B,C> F<B,F<B,C>> on(F<A,F<A,C>> a, F<B,A> f)
a
- The function whose arguments to apply another function over.f
- The function to apply over the arguments of another function.
public static <A,B,C,D> F<F<D,A>,F<F<D,B>,F<D,C>>> lift(F<A,F<B,C>> f)
f
- The function to promote.
public static <A,B> F<B,A> join(F<B,F<B,A>> f)
f
- A function whose arguments to join.
public static <A,B,C> F<A,C> partialApply2(F<A,F<B,C>> f, B b)
f
- The function to partially apply.b
- The value to apply to the function.
public static <A,B,C,D> F<A,F<B,D>> partialApply3(F<A,F<B,F<C,D>>> f, C c)
f
- The function to partially apply.c
- The value to apply to the function.
public static <A,B,C,D,E> F<A,F<B,F<C,E>>> partialApply4(F<A,F<B,F<C,F<D,E>>>> f, D d)
f
- The function to partially apply.d
- The value to apply to the function.
public static <A,B,C,D,E,F$> F<A,F<B,F<C,F<D,F$>>>> partialApply5(F<A,F<B,F<C,F<D,F<E,F$>>>>> f, E e)
f
- The function to partially apply.e
- The value to apply to the function.
public static <A,B,C,D,E,F$,G> F<A,F<B,F<C,F<D,F<E,G>>>>> partialApply6(F<A,F<B,F<C,F<D,F<E,F<F$,G>>>>>> f, F$ f$)
f
- The function to partially apply.f$
- The value to apply to the function.
public static <A,B,C,D,E,F$,G,H> F<A,F<B,F<C,F<D,F<E,F<F$,H>>>>>> partialApply7(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,H>>>>>>> f, G g)
f
- The function to partially apply.g
- The value to apply to the function.
public static <A,B,C,D,E,F$,G,H,I> F<A,F<B,F<C,F<D,F<E,F<F$,F<G,I>>>>>>> partialApply8(F<A,F<B,F<C,F<D,F<E,F<F$,F<G,F<H,I>>>>>>>> f, H h)
f
- The function to partially apply.h
- The value to apply to the function.
|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |