Package fj.data.optic
Class PTraversal<S,T,A,B>
java.lang.Object
fj.data.optic.PTraversal<S,T,A,B>
- Type Parameters:
S
- the source of aPTraversal
T
- the modified source of aPTraversal
A
- the target of aPTraversal
B
- the modified target of aPTraversal
- Direct Known Subclasses:
Traversal
A
PTraversal
can be seen as a POptional
generalised to 0 to n targets where n can be infinite.
PTraversal
stands for Polymorphic Traversal as it set and modify methods change a type A
to B
and S
to T
.
Traversal
is a PTraversal
restricted to monomoprhic updates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck if all targets satisfy the predicateasFold()
view aPTraversal
as aFold
asSetter()
view aPTraversal
as aPSetter
composeFold
(Fold<A, C> other) compose aPTraversal
with aFold
composeFold
(Getter<A, C> other) compose aPTraversal
with aGetter
final <C,
D> PTraversal <S, T, C, D> composeIso
(PIso<A, B, C, D> other) compose aPTraversal
with aPIso
final <C,
D> PTraversal <S, T, C, D> composeLens
(PLens<A, B, C, D> other) compose aPTraversal
with aPLens
final <C,
D> PTraversal <S, T, C, D> composeOptional
(POptional<A, B, C, D> other) compose aPTraversal
with aPOptional
final <C,
D> PTraversal <S, T, C, D> composePrism
(PPrism<A, B, C, D> other) compose aPTraversal
with aPPrism
composeSetter
(PSetter<A, B, C, D> other) compose aPTraversal
with aPSetter
final <C,
D> PTraversal <S, T, C, D> composeTraversal
(PTraversal<A, B, C, D> other) compose aPTraversal
with aPTraversal
check if at least one target satisfies the predicatefind the first target of aPTraversal
matching the predicatecombine all targets using a target'sMonoid
map each target to aMonoid
and combine the resultsprivate static <S,
T, A, B>
PTraversal<S, T, A, B> fromCurried
(PTraversal<S, F<B, T>, A, B> curriedTraversal, F<S, A> lastGet) get all the targets of aPTraversal
headOption
(S s) get the first target of aPTraversal
modify polymorphically the target of aPTraversal
with a functionmodifyEitherF
(F<A, Either<L, B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodifyFunctionF
(F<A, F<C, B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodify polymorphically the target of aPTraversal
with an Applicative functionmodifyListF
(F<A, List<B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodifyOptionF
(F<A, Option<B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodify polymorphically the target of aPTraversal
with an Applicative functionmodifyPromiseF
(F<A, Promise<B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodifyStreamF
(F<A, Stream<B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionabstract F
<S, Trampoline<T>> modifyTrampolineF
(F<A, Trampoline<B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionmodify polymorphically the target of aPTraversal
with an Applicative functionabstract <E> F
<S, Validation<E, T>> modifyValidationF
(Semigroup<E> s, F<A, Validation<E, B>> f) modify polymorphically the target of aPTraversal
with an Applicative functionstatic <S,
T> PTraversal <Either<S, S>, Either<T, T>, S, T> static <S,
T> PTraversal <S, T, S, T> pId()
static <S,
T, A, B>
PTraversal<S, T, A, B> pTraversal
(F<S, A> get1, F<S, A> get2, F<S, A> get3, F<S, A> get4, F<S, A> get5, F<S, A> get6, F7<B, B, B, B, B, B, S, T> set) static <S,
T, A, B>
PTraversal<S, T, A, B> static <S,
T, A, B>
PTraversal<S, T, A, B> static <S,
T, A, B>
PTraversal<S, T, A, B> pTraversal
(F<S, A> get1, F<S, A> get2, F<S, A> get3, F4<B, B, B, S, T> set) static <S,
T, A, B>
PTraversal<S, T, A, B> pTraversal
(F<S, A> get1, F<S, A> get2, F3<B, B, S, T> set) set polymorphically the target of aPTraversal
with a valuesum
(PTraversal<S1, T1, A, B> other) join twoPTraversal
with the same target
-
Constructor Details
-
PTraversal
public PTraversal()
-
-
Method Details
-
modifyFunctionF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyEitherF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyIOF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyTrampolineF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyPromiseF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyListF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyOptionF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyStreamF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyP1F
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyValidationF
modify polymorphically the target of aPTraversal
with an Applicative function -
modifyV2F
modify polymorphically the target of aPTraversal
with an Applicative function -
foldMap
map each target to aMonoid
and combine the results -
fold
combine all targets using a target'sMonoid
-
getAll
get all the targets of aPTraversal
-
find
find the first target of aPTraversal
matching the predicate -
headOption
get the first target of aPTraversal
-
exist
check if at least one target satisfies the predicate -
all
check if all targets satisfy the predicate -
modify
modify polymorphically the target of aPTraversal
with a function -
set
set polymorphically the target of aPTraversal
with a value -
sum
join twoPTraversal
with the same target -
composeFold
compose aPTraversal
with aFold
-
composeFold
compose aPTraversal
with aGetter
-
composeSetter
compose aPTraversal
with aPSetter
-
composeTraversal
compose aPTraversal
with aPTraversal
-
composeOptional
compose aPTraversal
with aPOptional
-
composePrism
compose aPTraversal
with aPPrism
-
composeLens
compose aPTraversal
with aPLens
-
composeIso
compose aPTraversal
with aPIso
-
asFold
view aPTraversal
as aFold
-
asSetter
view aPTraversal
as aPSetter
-
pId
-
pCodiagonal
-
pTraversal
public static <S,T, PTraversal<S,A, B> T, pTraversalA, B> (F<S, A> get1, F<S, A> get2, F3<B, B, S, T> set) -
pTraversal
public static <S,T, PTraversal<S,A, B> T, pTraversalA, B> (F<S, A> get1, F<S, A> get2, F<S, A> get3, F4<B, B, B, S, T> set) -
pTraversal
-
pTraversal
-
pTraversal
-
fromCurried
private static <S,T, PTraversal<S,A, B> T, fromCurriedA, B> (PTraversal<S, F<B, T>, A, B> curriedTraversal, F<S, A> lastGet)
-