Class/Object

monocle

PTraversal

Related Docs: object PTraversal | package monocle

Permalink

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]
See also

monocle.law.TraversalLaws

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PTraversal
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PTraversal()

    Permalink

Abstract Value Members

  1. abstract def modifyF[F[_]](f: (A) ⇒ F[B])(s: S)(implicit arg0: Applicative[F]): F[T]

    Permalink

    modify polymorphically the target of a PTraversal with an Applicative function all traversal methods are written in terms of modifyF

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def ^<->[C, D](other: PIso[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    alias to composeIso

    alias to composeIso

    Annotations
    @inline()
  5. final def ^<-?[C, D](other: PPrism[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    alias to composePrism

    alias to composePrism

    Annotations
    @inline()
  6. final def ^|->[C, D](other: PLens[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    alias to composeLens

    alias to composeLens

    Annotations
    @inline()
  7. final def ^|->>[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    alias to composeTraversal

    alias to composeTraversal

    Annotations
    @inline()
  8. final def ^|-?[C, D](other: POptional[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    alias to composeOptional

    alias to composeOptional

    Annotations
    @inline()
  9. final def all(p: (A) ⇒ Boolean): (S) ⇒ Boolean

    Permalink

    check if all targets satisfy the predicate

    check if all targets satisfy the predicate

    Annotations
    @inline()
  10. final def asFold: Fold[S, A]

    Permalink

    view a PTraversal as a Fold

    view a PTraversal as a Fold

    Annotations
    @inline()
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. final def asSetter: PSetter[S, T, A, B]

    Permalink

    view a PTraversal as a PSetter

    view a PTraversal as a PSetter

    Annotations
    @inline()
  13. final def choice[S1, T1](other: PTraversal[S1, T1, A, B]): PTraversal[\/[S, S1], \/[T, T1], A, B]

    Permalink

    join two PTraversal with the same target

    join two PTraversal with the same target

    Annotations
    @inline()
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def composeFold[C](other: Fold[A, C]): Fold[S, C]

    Permalink

    compose a PTraversal with a Fold

    compose a PTraversal with a Fold

    Annotations
    @inline()
  16. final def composeGetter[C](other: Getter[A, C]): Fold[S, C]

    Permalink

    compose a PTraversal with a Getter

    compose a PTraversal with a Getter

    Annotations
    @inline()
  17. final def composeIso[C, D](other: PIso[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    compose a PTraversal with a PIso

    compose a PTraversal with a PIso

    Annotations
    @inline()
  18. final def composeLens[C, D](other: PLens[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    compose a PTraversal with a PLens

    compose a PTraversal with a PLens

    Annotations
    @inline()
  19. final def composeOptional[C, D](other: POptional[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    compose a PTraversal with a POptional

    compose a PTraversal with a POptional

    Annotations
    @inline()
  20. final def composePrism[C, D](other: PPrism[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    compose a PTraversal with a PPrism

    compose a PTraversal with a PPrism

    Annotations
    @inline()
  21. final def composeSetter[C, D](other: PSetter[A, B, C, D]): PSetter[S, T, C, D]

    Permalink

    compose a PTraversal with a PSetter

    compose a PTraversal with a PSetter

    Annotations
    @inline()
  22. final def composeTraversal[C, D](other: PTraversal[A, B, C, D]): PTraversal[S, T, C, D]

    Permalink

    compose a PTraversal with a PTraversal

    compose a PTraversal with a PTraversal

    Annotations
    @inline()
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def exist(p: (A) ⇒ Boolean): (S) ⇒ Boolean

    Permalink

    check if at least one target satisfies the predicate

    check if at least one target satisfies the predicate

    Annotations
    @inline()
  26. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. final def find(p: (A) ⇒ Boolean): (S) ⇒ Option[A]

    Permalink

    find the first target matching the predicate

    find the first target matching the predicate

    Annotations
    @inline()
  28. final def fold(s: S)(implicit ev: Monoid[A]): A

    Permalink

    combine all targets using a target's Monoid

    combine all targets using a target's Monoid

    Annotations
    @inline()
  29. final def foldMap[M](f: (A) ⇒ M)(s: S)(implicit arg0: Monoid[M]): M

    Permalink

    map each target to a Monoid and combine the results

    map each target to a Monoid and combine the results

    Annotations
    @inline()
  30. final def getAll(s: S): List[A]

    Permalink

    get all the targets of a PTraversal

    get all the targets of a PTraversal

    Annotations
    @inline()
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def headOption(s: S): Option[A]

    Permalink

    get the first target

    get the first target

    Annotations
    @inline()
  34. final def isEmpty(s: S): Boolean

    Permalink

    check if there is no target

    check if there is no target

    Annotations
    @inline()
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. final def lastOption(s: S): Option[A]

    Permalink

    get the last target

    get the last target

    Annotations
    @inline()
  37. final def length(s: S): Int

    Permalink

    calculate the number of targets

    calculate the number of targets

    Annotations
    @inline()
  38. final def modify(f: (A) ⇒ B): (S) ⇒ T

    Permalink

    modify polymorphically the target of a PTraversal with a function

    modify polymorphically the target of a PTraversal with a function

    Annotations
    @inline()
  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def nonEmpty(s: S): Boolean

    Permalink

    check if there is at least one target

    check if there is at least one target

    Annotations
    @inline()
  41. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. final def set(b: B): (S) ⇒ T

    Permalink

    set polymorphically the target of a PTraversal with a value

    set polymorphically the target of a PTraversal with a value

    Annotations
    @inline()
  44. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  45. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  46. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def sum[S1, T1](other: PTraversal[S1, T1, A, B]): PTraversal[\/[S, S1], \/[T, T1], A, B]

    Permalink
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 1.2.0) use choice

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped