monocle

PLens

final class PLens[S, T, A, B] extends AnyRef

A PLens can be seen as a pair of functions: get: S => A i.e. from an S, we can extract an A set: (B, S) => T i.e. if we replace an A by a B in a S, we obtain a T

A PLens could also be defined as a weaker PIso where set requires an additional parameter than reverseGet.

PLens stands for Polymorphic Lens as it set and modify methods change a type A to B and S to T. Lens is a type alias for PLens restricted to monomoprhic updates:

type Lens[S, A] = PLens[S, S, A, A]

A PLens is also a valid Getter, Fold, POptional, PTraversal and PSetter

Typically a PLens or Lens can be defined between a Product (e.g. case class, tuple, HList) and one of it is component.

S

the source of a PLens

T

the modified source of a PLens

A

the target of a PLens

B

the modified target of a PLens

Self Type
PLens[S, T, A, B]
See also

LensLaws in monocle-law module

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PLens
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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 ^<->[C, D](other: PIso[A, B, C, D]): PLens[S, T, C, D]

    alias to composeIso

    alias to composeIso

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

    alias to composePrism

    alias to composePrism

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

    alias to composeLens

    alias to composeLens

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

    alias to composeTraversal

    alias to composeTraversal

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

    alias to composeOptional

    alias to composeOptional

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

    view a PLens as a Fold

    view a PLens as a Fold

    Annotations
    @inline()
  10. def asGetter: Getter[S, A]

    view a PLens as a Getter

    view a PLens as a Getter

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

    Definition Classes
    Any
  12. def asOptional: POptional[S, T, A, B]

    view a PLens as an POptional

    view a PLens as an POptional

    Annotations
    @inline()
  13. def asSetter: PSetter[S, T, A, B]

    view a PLens as a PSetter

    view a PLens as a PSetter

    Annotations
    @inline()
  14. def asTraversal: PTraversal[S, T, A, B]

    view a PLens as a PTraversal

    view a PLens as a PTraversal

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

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

    compose a PLens with a Fold

    compose a PLens with a Fold

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

    compose a PLens with a Getter

    compose a PLens with a Getter

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

    compose a PLens with an PIso

    compose a PLens with an PIso

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

    compose a PLens with a PLens

    compose a PLens with a PLens

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

    compose a PLens with an POptional

    compose a PLens with an POptional

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

    compose a PLens with a PPrism

    compose a PLens with a PPrism

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

    compose a PLens with a PSetter

    compose a PLens with a PSetter

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

    compose a PLens with a PTraversal

    compose a PLens with a PTraversal

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

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

    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. val get: (S) ⇒ A

    get the target of a PLens

  28. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  30. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  31. def modify(f: (A) ⇒ B): (S) ⇒ T

    modify polymorphically the target of a PLens using a function

    modify polymorphically the target of a PLens using a function

    Annotations
    @inline()
  32. def modifyF[F[_]](f: (A) ⇒ F[B])(s: S)(implicit arg0: Functor[F]): F[T]

    modify polymorphically the target of a PLens using Functor function

    modify polymorphically the target of a PLens using Functor function

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

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. val set: (B) ⇒ (S) ⇒ T

    set polymorphically the target of a PLens with a value

  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped