trait PTraversal[S, T, A, B] extends PSetter[S, T, A, B] with Fold[S, A]

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 replace 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

monocle.law.TraversalLaws

Linear Supertypes
Fold[S, A], PSetter[S, T, A, B], Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PTraversal
  2. Fold
  3. PSetter
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def modifyA[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 modifyA

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def all(p: (A) => Boolean): (S) => Boolean

    check if all targets satisfy the predicate

    check if all targets satisfy the predicate

    Definition Classes
    Fold
  5. def andThen[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]

    compose a PTraversal with another PTraversal

  6. def andThen[B](other: Fold[A, B]): Fold[S, B]

    compose a Fold with another Fold

    compose a Fold with another Fold

    Definition Classes
    Fold
  7. def andThen[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]

    compose a PSetter with another PSetter

    compose a PSetter with another PSetter

    Definition Classes
    PSetter
  8. def asFold: Fold[S, A]

    view a PTraversal as a Fold

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def asSetter: PSetter[S, T, A, B]

    view a PTraversal as a PSetter

  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. 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

    Definition Classes
    Fold
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. def find(p: (A) => Boolean): (S) => Option[A]

    find the first target matching the predicate

    find the first target matching the predicate

    Definition Classes
    Fold
  17. 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

    Definition Classes
    Fold
  18. 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

    Definition Classes
    PTraversalFold
  19. def getAll(s: S): List[A]

    get all the targets of a Fold

    get all the targets of a Fold

    Definition Classes
    Fold
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def headOption(s: S): Option[A]

    get the first target

    get the first target

    Definition Classes
    Fold
  23. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1], evMonoS: =:=[S, T], evMonoA: =:=[A, B]): Traversal[S, A1]
    Definition Classes
    PTraversalPSetter
  24. def index[I, A1](i: I)(implicit evIndex: Index[A, I, A1]): Fold[S, A1]
    Definition Classes
    Fold
  25. def isEmpty(s: S): Boolean

    check if there is no target

    check if there is no target

    Definition Classes
    Fold
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def lastOption(s: S): Option[A]

    get the last target

    get the last target

    Definition Classes
    Fold
  28. def length(s: S): Int

    calculate the number of targets

    calculate the number of targets

    Definition Classes
    Fold
  29. 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

    Definition Classes
    PTraversalPSetter
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def nonEmpty(s: S): Boolean

    check if there is at least one target

    check if there is at least one target

    Definition Classes
    Fold
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. def parModifyF[F[_]](f: (A) => F[B])(s: S)(implicit F: Parallel[F]): F[T]

    PTraversal.modifyA for a Parallel applicative functor.

  35. def replace(b: B): (S) => T

    replace polymorphically the target of a PTraversal with a value

    replace polymorphically the target of a PTraversal with a value

    Definition Classes
    PTraversalPSetter
  36. def some[A1, B1](implicit ev1: =:=[A, Option[A1]], ev2: =:=[B, Option[B1]]): PTraversal[S, T, A1, B1]
    Definition Classes
    PTraversalPSetter
  37. def some[A1](implicit ev1: =:=[A, Option[A1]]): Fold[S, A1]
    Definition Classes
    Fold
  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. def to[C](f: (A) => C): Fold[S, C]

    Compose with a function lifted into a Getter

    Compose with a function lifted into a Getter

    Definition Classes
    Fold
  40. def toString(): String
    Definition Classes
    AnyRef → Any
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def left[C]: Fold[Either[S, C], Either[A, C]]
    Definition Classes
    Fold
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  2. def right[C]: Fold[Either[C, S], Either[C, A]]
    Definition Classes
    Fold
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M4) no replacement

  3. def set(b: B): (S) => T

    alias to replace

    alias to replace

    Definition Classes
    PSetter
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0-M1) use replace instead

Inherited from Fold[S, A]

Inherited from PSetter[S, T, A, B]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped