V
- Type of the value passed as the first argumentFN
- The function to partially apply.PARTIALFN
- The resulting partially applied function.public abstract class PartialApplication<FN extends no.motif.f.FnType,V,PARTIALFN extends no.motif.f.FnType> extends Object implements Fn<V,PARTIALFN>
PartialApplication
is used to build more specialized
functions from another function. It is itself a higher order function
(Fn<V, FN>
) which takes a value, and yields the
specialized function, where the value is passed as the first
argument to the more generic function.
When doing a partial application of a function with n arguments, a function taking n-1 arguments is yielded, where n > 0. Applying the yielded function will complete the partial application.
Modifier and Type | Method and Description |
---|---|
PARTIALFN |
$(V value)
Applies the function.
|
PARTIALFN |
of(Fn0<V> value) |
PARTIALFN |
of(V value) |
protected abstract PARTIALFN |
partiallyApply(FN fn,
Fn0<V> arg)
Do the partial application, i.e.
|
protected abstract PARTIALFN partiallyApply(FN fn, Fn0<V> arg)
fn
- the function to partially applyarg
- the argument to partially apply fn
with.Copyright © 2016. All Rights Reserved.