Class PTraversal<S,T,A,B>
java.lang.Object
fj.data.optic.PTraversal<S,T,A,B>
- Type Parameters:
S- the source of aPTraversalT- the modified source of aPTraversalA- the target of aPTraversalB- 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 aPTraversalas aFoldasSetter()view aPTraversalas aPSettercomposeFold(Fold<A, C> other) compose aPTraversalwith aFoldcomposeFold(Getter<A, C> other) compose aPTraversalwith aGetterfinal <C,D> PTraversal <S, T, C, D> composeIso(PIso<A, B, C, D> other) compose aPTraversalwith aPIsofinal <C,D> PTraversal <S, T, C, D> composeLens(PLens<A, B, C, D> other) compose aPTraversalwith aPLensfinal <C,D> PTraversal <S, T, C, D> composeOptional(POptional<A, B, C, D> other) compose aPTraversalwith aPOptionalfinal <C,D> PTraversal <S, T, C, D> composePrism(PPrism<A, B, C, D> other) compose aPTraversalwith aPPrismcomposeSetter(PSetter<A, B, C, D> other) compose aPTraversalwith aPSetterfinal <C,D> PTraversal <S, T, C, D> composeTraversal(PTraversal<A, B, C, D> other) compose aPTraversalwith aPTraversalcheck if at least one target satisfies the predicatefind the first target of aPTraversalmatching the predicatecombine all targets using a target'sMonoidmap each target to aMonoidand 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 aPTraversalheadOption(S s) get the first target of aPTraversalmodify polymorphically the target of aPTraversalwith a functionmodifyEitherF(F<A, Either<L, B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyFunctionF(F<A, F<C, B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodify polymorphically the target of aPTraversalwith an Applicative functionmodifyListF(F<A, List<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyOptionF(F<A, Option<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodify polymorphically the target of aPTraversalwith an Applicative functionmodifyPromiseF(F<A, Promise<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyStreamF(F<A, Stream<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionabstract F<S, Trampoline<T>> modifyTrampolineF(F<A, Trampoline<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodify polymorphically the target of aPTraversalwith an Applicative functionabstract <E> F<S, Validation<E, T>> modifyValidationF(Semigroup<E> s, F<A, Validation<E, B>> f) modify polymorphically the target of aPTraversalwith 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 aPTraversalwith a valuesum(PTraversal<S1, T1, A, B> other) join twoPTraversalwith the same target
-
Constructor Details
-
PTraversal
public PTraversal()
-
-
Method Details
-
modifyFunctionF
-
modifyEitherF
-
modifyIOF
-
modifyTrampolineF
modify polymorphically the target of aPTraversalwith an Applicative function -
modifyPromiseF
-
modifyListF
-
modifyOptionF
-
modifyStreamF
-
modifyP1F
-
modifyValidationF
public abstract <E> F<S, Validation<E,T>> modifyValidationF(Semigroup<E> s, F<A, Validation<E, B>> f) modify polymorphically the target of aPTraversalwith an Applicative function -
modifyV2F
-
foldMap
-
fold
-
getAll
get all the targets of aPTraversal -
find
-
headOption
get the first target of aPTraversal -
exist
-
all
-
modify
-
set
set polymorphically the target of aPTraversalwith a value -
sum
join twoPTraversalwith the same target -
composeFold
-
composeFold
-
composeSetter
-
composeTraversal
compose aPTraversalwith aPTraversal -
composeOptional
compose aPTraversalwith aPOptional -
composePrism
compose aPTraversalwith aPPrism -
composeLens
compose aPTraversalwith aPLens -
composeIso
compose aPTraversalwith aPIso -
asFold
view aPTraversalas aFold -
asSetter
-
pId
-
pCodiagonal
-
pTraversal
-
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)
-