S - the source of a PTraversalT - the modified source of a PTraversalA - the target of a PTraversalB - the modified target of a PTraversalpublic abstract class PTraversal<S,T,A,B> extends Object
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 monomorphic updates.
| Constructor and Description |
|---|
PTraversal() |
| Modifier and Type | Method and Description |
|---|---|
Predicate<S> |
all(Predicate<A> p)
check if all targets satisfy the predicate
|
Fold<S,A> |
asFold()
view a
PTraversal as a Fold |
PSetter<S,T,A,B> |
asSetter()
view a
PTraversal as a PSetter |
<C> Fold<S,C> |
composeFold(Fold<A,C> other)
compose a
PTraversal with a Fold |
<C> Fold<S,C> |
composeFold(Getter<A,C> other)
compose a
PTraversal with a Getter |
<C,D> PTraversal<S,T,C,D> |
composeIso(PIso<A,B,C,D> other)
compose a
PTraversal with a PIso |
<C,D> PTraversal<S,T,C,D> |
composeLens(PLens<A,B,C,D> other)
compose a
PTraversal with a PLens |
<C,D> PTraversal<S,T,C,D> |
composeOptional(POptional<A,B,C,D> other)
compose a
PTraversal with a POptional |
<C,D> PTraversal<S,T,C,D> |
composePrism(PPrism<A,B,C,D> other)
compose a
PTraversal with a PPrism |
<C,D> PSetter<S,T,C,D> |
composeSetter(PSetter<A,B,C,D> other)
compose a
PTraversal with a PSetter |
<C,D> PTraversal<S,T,C,D> |
composeTraversal(PTraversal<A,B,C,D> other)
compose a
PTraversal with a PTraversal |
Predicate<S> |
exist(Predicate<A> p)
check if at least one target satisfies the predicate
|
Function<S,Option<A>> |
find(Predicate<A> p)
find the first target of a
PTraversal matching the predicate |
Function<S,A> |
fold(Monoid<A> monoid)
combine all targets using a target's
Monoid |
abstract <M> Function<S,M> |
foldMap(Monoid<M> monoid,
Function<A,M> f)
map each target to a
Monoid and combine the results |
Iterable<A> |
getAll(S s)
get all the targets of a
PTraversal |
Option<A> |
headOption(S s)
get the first target of a
PTraversal |
Function<S,T> |
modify(Function<A,B> f)
modify polymorphically the target of a
PTraversal with a function |
abstract <L> Function<S,Either<L,T>> |
modifyEitherF(Function<A,Either<L,B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
abstract <C> Function<S,Function<C,T>> |
modifyFunctionF(Function<A,Function<C,B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
abstract Function<S,Iterable<T>> |
modifyIterableF(Function<A,Iterable<B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
abstract Function<S,Option<T>> |
modifyOptionF(Function<A,Option<B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
abstract Function<S,Pair<T,T>> |
modifyPairF(Function<A,Pair<B,B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
abstract Function<S,Supplier<T>> |
modifySupplierF(Function<A,Supplier<B>> f)
modify polymorphically the target of a
PTraversal with an
Applicative function |
static <S,T> PTraversal<Either<S,S>,Either<T,T>,S,T> |
pCodiagonal() |
static <S,T> PTraversal<S,T,S,T> |
pId() |
static <S,T,A,B> PTraversal<S,T,A,B> |
pTraversal(Function<S,A> get1,
Function<S,A> get2,
BiFunction<B,B,Function<S,T>> set) |
static <S,T,A,B> PTraversal<S,T,A,B> |
pTraversal(Function<S,A> get1,
Function<S,A> get2,
Function<S,A> get3,
Function<B,Function<B,Function<B,Function<S,T>>>> set) |
static <S,T,A,B> PTraversal<S,T,A,B> |
pTraversal(Function<S,A> get1,
Function<S,A> get2,
Function<S,A> get3,
Function<S,A> get4,
Function<B,Function<B,Function<B,Function<B,Function<S,T>>>>> set) |
static <S,T,A,B> PTraversal<S,T,A,B> |
pTraversal(Function<S,A> get1,
Function<S,A> get2,
Function<S,A> get3,
Function<S,A> get4,
Function<S,A> get5,
Function<B,Function<B,Function<B,Function<B,Function<B,Function<S,T>>>>>> set) |
static <S,T,A,B> PTraversal<S,T,A,B> |
pTraversal(Function<S,A> get1,
Function<S,A> get2,
Function<S,A> get3,
Function<S,A> get4,
Function<S,A> get5,
Function<S,A> get6,
Function<B,Function<B,Function<B,Function<B,Function<B,Function<B,Function<S,T>>>>>>> set) |
Function<S,T> |
set(B b)
set polymorphically the target of a
PTraversal with a value |
<S1,T1> PTraversal<Either<S,S1>,Either<T,T1>,A,B> |
sum(PTraversal<S1,T1,A,B> other)
join two
PTraversal with the same target |
public abstract <C> Function<S,Function<C,T>> modifyFunctionF(Function<A,Function<C,B>> f)
PTraversal with an
Applicative functionpublic abstract <L> Function<S,Either<L,T>> modifyEitherF(Function<A,Either<L,B>> f)
PTraversal with an
Applicative functionpublic abstract Function<S,Option<T>> modifyOptionF(Function<A,Option<B>> f)
PTraversal with an
Applicative functionpublic abstract Function<S,Iterable<T>> modifyIterableF(Function<A,Iterable<B>> f)
PTraversal with an
Applicative functionpublic abstract Function<S,Supplier<T>> modifySupplierF(Function<A,Supplier<B>> f)
PTraversal with an
Applicative functionpublic abstract Function<S,Pair<T,T>> modifyPairF(Function<A,Pair<B,B>> f)
PTraversal with an
Applicative functionpublic abstract <M> Function<S,M> foldMap(Monoid<M> monoid, Function<A,M> f)
Monoid and combine the resultspublic final Iterable<A> getAll(S s)
PTraversalpublic final Function<S,Option<A>> find(Predicate<A> p)
PTraversal matching the predicatepublic final Option<A> headOption(S s)
PTraversalpublic final Predicate<S> exist(Predicate<A> p)
public final Function<S,T> modify(Function<A,B> f)
PTraversal with a functionpublic final Function<S,T> set(B b)
PTraversal with a valuepublic final <S1,T1> PTraversal<Either<S,S1>,Either<T,T1>,A,B> sum(PTraversal<S1,T1,A,B> other)
PTraversal with the same targetpublic final <C> Fold<S,C> composeFold(Fold<A,C> other)
PTraversal with a Foldpublic final <C> Fold<S,C> composeFold(Getter<A,C> other)
PTraversal with a Getterpublic final <C,D> PSetter<S,T,C,D> composeSetter(PSetter<A,B,C,D> other)
PTraversal with a PSetterpublic final <C,D> PTraversal<S,T,C,D> composeTraversal(PTraversal<A,B,C,D> other)
PTraversal with a PTraversalpublic final <C,D> PTraversal<S,T,C,D> composeOptional(POptional<A,B,C,D> other)
PTraversal with a POptionalpublic final <C,D> PTraversal<S,T,C,D> composePrism(PPrism<A,B,C,D> other)
PTraversal with a PPrismpublic final <C,D> PTraversal<S,T,C,D> composeLens(PLens<A,B,C,D> other)
PTraversal with a PLenspublic final <C,D> PTraversal<S,T,C,D> composeIso(PIso<A,B,C,D> other)
PTraversal with a PIsopublic final Fold<S,A> asFold()
PTraversal as a Foldpublic static <S,T> PTraversal<S,T,S,T> pId()
public static <S,T> PTraversal<Either<S,S>,Either<T,T>,S,T> pCodiagonal()
public static <S,T,A,B> PTraversal<S,T,A,B> pTraversal(Function<S,A> get1, Function<S,A> get2, BiFunction<B,B,Function<S,T>> set)
public static <S,T,A,B> PTraversal<S,T,A,B> pTraversal(Function<S,A> get1, Function<S,A> get2, Function<S,A> get3, Function<B,Function<B,Function<B,Function<S,T>>>> set)
public static <S,T,A,B> PTraversal<S,T,A,B> pTraversal(Function<S,A> get1, Function<S,A> get2, Function<S,A> get3, Function<S,A> get4, Function<B,Function<B,Function<B,Function<B,Function<S,T>>>>> set)
public static <S,T,A,B> PTraversal<S,T,A,B> pTraversal(Function<S,A> get1, Function<S,A> get2, Function<S,A> get3, Function<S,A> get4, Function<S,A> get5, Function<B,Function<B,Function<B,Function<B,Function<B,Function<S,T>>>>>> set)
Copyright © 2018 Atlassian. All rights reserved.