| Package | Description |
|---|---|
| org.organicdesign.fp.collections |
Type-safe versions of the immutable Clojure collections, plus unmodifiable and immutable
collection interfaces that extend the java.util collections, deprecating the mutate-in-place
methods (Unmod____) and adding methods that return a new, immutable, modified version of the
collection (Im____).
|
| org.organicdesign.fp.function |
Exception-friendly functional interfaces named by the number of arguments: Function0, Function1, Function2....
|
| org.organicdesign.fp.xform |
Immutable descriptions of data transformations (Transformable), and a highly efficient
single-pass, short-circuiting implementation that carries out those transforms in a single pass
(Xform).
|
| Modifier and Type | Method and Description |
|---|---|
default <B> B |
UnmodIterable.foldLeft(B ident,
Function2<B,? super T,B> reducer)
Apply the function to each item, accumulating the result in u.
|
default <B> B |
UnmodIterable.foldLeft(B ident,
Function2<B,? super T,B> reducer,
Function1<? super B,Boolean> terminateWhen)
Normally you want to terminate by doing a take(), drop(), or takeWhile() before you get to the
fold, but if you need to terminate based on the complete result so far, you can provide your
own termination condition to this version of foldLeft().
|
static <T> void |
UnmodList.permutations(List<T> items,
Function2<? super T,? super T,?> f)
Apply the given function against all unique pairings of items in the list.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B,Z> Function2<A,B,Z> |
Function2.memoize(Function2<A,B,Z> f)
Use only on pure functions with no side effects.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B,Z> Function2<A,B,Z> |
Function2.memoize(Function2<A,B,Z> f)
Use only on pure functions with no side effects.
|
| Modifier and Type | Method and Description |
|---|---|
<B> B |
Xform.foldLeft(B ident,
Function2<B,? super A,B> reducer)
Provides a way to collect the results of the transformation.
|
<B> B |
Xform.foldLeft(B ident,
Function2<B,? super A,B> reducer,
Function1<? super B,Boolean> terminateWhen)
Thit implementation should be correct, but could be slow in the case where previous operations
are slow and the terminateWhen operation is fast and terminates early.
|
<U> U |
Transformable.foldLeft(U u,
Function2<U,? super T,U> fun)
Apply the function to each item, accumulating the result in u.
|
<U> U |
Transformable.foldLeft(U u,
Function2<U,? super T,U> fun,
Function1<? super U,Boolean> terminateWhen)
Normally you want to terminate by doing a take(), drop(), or takeWhile() before you get to the
fold, but if you need to terminate based on the complete result so far, you can provide your
own termination condition to this version of foldLeft().
|
Copyright © 2017. All rights reserved.