Constructor and Description |
---|
Fold() |
Modifier and Type | Method and Description |
---|---|
F<S,java.lang.Boolean> |
all(F<A,java.lang.Boolean> p)
check if all targets satisfy the predicate
|
static <A> Fold<Either<A,A>,A> |
codiagonal() |
<B> Fold<S,B> |
composeFold(Fold<A,B> other)
|
<C> Fold<S,C> |
composeGetter(Getter<A,C> other)
|
<B,C,D> Fold<S,C> |
composeIso(PIso<A,B,C,D> other)
|
<B,C,D> Fold<S,C> |
composeLens(PLens<A,B,C,D> other)
|
<B,C,D> Fold<S,C> |
composeOptional(POptional<A,B,C,D> other)
|
<B,C,D> Fold<S,C> |
composePrism(PPrism<A,B,C,D> other)
|
F<S,java.lang.Boolean> |
exist(F<A,java.lang.Boolean> p)
check if at least one target satisfies the predicate
|
F<S,Option<A>> |
find(F<A,java.lang.Boolean> p)
find the first target of a
Fold matching the predicate |
F<S,A> |
fold(Monoid<A> m)
combine all targets using a target's
Monoid |
abstract <M> F<S,M> |
foldMap(Monoid<M> m,
F<A,M> f)
|
List<A> |
getAll(S s)
get all the targets of a
Fold TODO: Shall it return a Stream as there might be an infinite number of targets? |
Option<A> |
headOption(S s)
get the first target of a
Fold |
static <A> Fold<A,A> |
id() |
<S1> Fold<Either<S,S1>,A> |
sum(Fold<S1,A> other)
join two
Fold with the same target |
public final List<A> getAll(S s)
Fold
TODO: Shall it return a Stream as there might be an infinite number of targets?public final F<S,Option<A>> find(F<A,java.lang.Boolean> p)
Fold
matching the predicatepublic final F<S,java.lang.Boolean> exist(F<A,java.lang.Boolean> p)
public final F<S,java.lang.Boolean> all(F<A,java.lang.Boolean> p)
public static <A> Fold<A,A> id()