Package fj.data.optic
Class Fold<S,A>
- java.lang.Object
-
- fj.data.optic.Fold<S,A>
-
-
Constructor Summary
Constructors Constructor Description Fold()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description F<S,java.lang.Boolean>all(F<A,java.lang.Boolean> p)check if all targets satisfy the predicatestatic <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 predicateF<S,Option<A>>find(F<A,java.lang.Boolean> p)find the first target of aFoldmatching the predicateF<S,A>fold(Monoid<A> m)combine all targets using a target'sMonoidabstract <M> F<S,M>foldMap(Monoid<M> m, F<A,M> f)List<A>getAll(S s)get all the targets of aFoldTODO: Shall it return a Stream as there might be an infinite number of targets?Option<A>headOption(S s)get the first target of aFoldstatic <A> Fold<A,A>id()<S1> Fold<Either<S,S1>,A>sum(Fold<S1,A> other)join twoFoldwith the same target
-
-
-
Method Detail
-
getAll
public final List<A> getAll(S s)
get all the targets of aFoldTODO: Shall it return a Stream as there might be an infinite number of targets?
-
find
public final F<S,Option<A>> find(F<A,java.lang.Boolean> p)
find the first target of aFoldmatching the predicate
-
exist
public final F<S,java.lang.Boolean> exist(F<A,java.lang.Boolean> p)
check if at least one target satisfies the predicate
-
all
public final F<S,java.lang.Boolean> all(F<A,java.lang.Boolean> p)
check if all targets satisfy the predicate
-
sum
public final <S1> Fold<Either<S,S1>,A> sum(Fold<S1,A> other)
join twoFoldwith the same target
-
id
public static <A> Fold<A,A> id()
-
-