abstract class PTraversal[S, T, A, B] extends Serializable
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 type alias for PTraversal restricted to monomorphic updates:
type Traversal[S, A] = PTraversal[S, S, A, A]
- S
the source of a PTraversal
- T
the modified source of a PTraversal
- A
the target of a PTraversal
- B
the modified target of a PTraversal
- Self Type
- PTraversal[S, T, A, B]
- Source
- Traversal.scala
- See also
- Alphabetic
- By Inheritance
- PTraversal
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PTraversal()
Abstract Value Members
- abstract def modifyF[F[_]](f: (A) => F[B])(s: S)(implicit arg0: Applicative[F]): F[T]
modify polymorphically the target of a PTraversal with an Applicative function all traversal methods are written in terms of modifyF
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ^<->[C, D](other: PIso[A, B, C, D]): PTraversal[S, T, C, D]
alias to composeIso
alias to composeIso
- Annotations
- @inline()
- final def ^<-?[C, D](other: PPrism[A, B, C, D]): PTraversal[S, T, C, D]
alias to composePrism
alias to composePrism
- Annotations
- @inline()
- final def ^|->[C, D](other: PLens[A, B, C, D]): PTraversal[S, T, C, D]
alias to composeLens
alias to composeLens
- Annotations
- @inline()
- final def ^|->>[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]
alias to composeTraversal
alias to composeTraversal
- Annotations
- @inline()
- final def ^|-?[C, D](other: POptional[A, B, C, D]): PTraversal[S, T, C, D]
alias to composeOptional
alias to composeOptional
- Annotations
- @inline()
- final def all(p: (A) => Boolean): (S) => Boolean
check if all targets satisfy the predicate
check if all targets satisfy the predicate
- Annotations
- @inline()
- final def asFold: Fold[S, A]
view a PTraversal as a Fold
view a PTraversal as a Fold
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def asSetter: PSetter[S, T, A, B]
view a PTraversal as a PSetter
view a PTraversal as a PSetter
- Annotations
- @inline()
- final def choice[S1, T1](other: PTraversal[S1, T1, A, B]): PTraversal[Either[S, S1], Either[T, T1], A, B]
join two PTraversal with the same target
join two PTraversal with the same target
- Annotations
- @inline()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def composeFold[C](other: Fold[A, C]): Fold[S, C]
compose a PTraversal with a Fold
compose a PTraversal with a Fold
- Annotations
- @inline()
- final def composeGetter[C](other: Getter[A, C]): Fold[S, C]
compose a PTraversal with a Getter
compose a PTraversal with a Getter
- Annotations
- @inline()
- final def composeIso[C, D](other: PIso[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with a PIso
compose a PTraversal with a PIso
- Annotations
- @inline()
- final def composeLens[C, D](other: PLens[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with a PLens
compose a PTraversal with a PLens
- Annotations
- @inline()
- final def composeOptional[C, D](other: POptional[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with a POptional
compose a PTraversal with a POptional
- Annotations
- @inline()
- final def composePrism[C, D](other: PPrism[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with a PPrism
compose a PTraversal with a PPrism
- Annotations
- @inline()
- final def composeSetter[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]
compose a PTraversal with a PSetter
compose a PTraversal with a PSetter
- Annotations
- @inline()
- final def composeTraversal[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]
compose a PTraversal with a PTraversal
compose a PTraversal with a PTraversal
- Annotations
- @inline()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def exist(p: (A) => Boolean): (S) => Boolean
check if at least one target satisfies the predicate
check if at least one target satisfies the predicate
- Annotations
- @inline()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def find(p: (A) => Boolean): (S) => Option[A]
find the first target matching the predicate
find the first target matching the predicate
- Annotations
- @inline()
- final def fold(s: S)(implicit ev: Monoid[A]): A
combine all targets using a target's Monoid
combine all targets using a target's Monoid
- Annotations
- @inline()
- final def foldMap[M](f: (A) => M)(s: S)(implicit arg0: Monoid[M]): M
map each target to a Monoid and combine the results
map each target to a Monoid and combine the results
- Annotations
- @inline()
- final def getAll(s: S): List[A]
get all the targets of a PTraversal
get all the targets of a PTraversal
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def headOption(s: S): Option[A]
get the first target
get the first target
- Annotations
- @inline()
- final def isEmpty(s: S): Boolean
check if there is no target
check if there is no target
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def lastOption(s: S): Option[A]
get the last target
get the last target
- Annotations
- @inline()
- final def length(s: S): Int
calculate the number of targets
calculate the number of targets
- Annotations
- @inline()
- final def modify(f: (A) => B): (S) => T
modify polymorphically the target of a PTraversal with a function
modify polymorphically the target of a PTraversal with a function
- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nonEmpty(s: S): Boolean
check if there is at least one target
check if there is at least one target
- Annotations
- @inline()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def parModifyF[F[_]](f: (A) => F[B])(s: S)(implicit F: Parallel[F]): F[T]
PTraversal.modifyF for a
Parallel
applicative functor.PTraversal.modifyF for a
Parallel
applicative functor.- Annotations
- @inline()
- final def set(b: B): (S) => T
set polymorphically the target of a PTraversal with a value
set polymorphically the target of a PTraversal with a value
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()