Class/Object

monocle

PLens

Related Docs: object PLens | package monocle

Permalink

abstract class PLens[S, T, A, B] extends Serializable

A PLens can be seen as a pair of functions:

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

monocle.law.LensLaws

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

Instance Constructors

  1. new PLens()

    Permalink

Abstract Value Members

  1. abstract def get(s: S): A

    Permalink

    get the target of a PLens

  2. abstract def modify(f: (A) ⇒ B): (S) ⇒ T

    Permalink

    modify polymorphically the target of a PLens using a function

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

    Permalink

    modify polymorphically the target of a PLens using Functor function

  4. abstract def set(b: B): (S) ⇒ T

    Permalink

    set polymorphically the target of a PLens using a function

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]): PLens[S, T, C, D]

    Permalink

    alias to composeIso

    alias to composeIso

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

    Permalink

    alias to composePrism

    alias to composePrism

    Annotations
    @inline()
  6. final def ^|->[C, D](other: PLens[A, B, C, D]): PLens[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]): POptional[S, T, C, D]

    Permalink

    alias to composeOptional

    alias to composeOptional

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

    Permalink

    view a PLens as a Fold

    view a PLens as a Fold

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

    Permalink

    view a PLens as a Getter

    view a PLens as a Getter

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

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

    Permalink

    view a PLens as an POptional

    view a PLens as an POptional

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

    Permalink

    view a PLens as a PSetter

    view a PLens as a PSetter

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

    Permalink

    view a PLens as a PTraversal

    view a PLens as a PTraversal

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

    Permalink

    join two PLens with the same target

    join two PLens with the same target

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

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

    Permalink

    compose a PLens with a Fold

    compose a PLens with a Fold

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

    Permalink

    compose a PLens with a Getter

    compose a PLens with a Getter

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

    Permalink

    compose a PLens with an PIso

    compose a PLens with an PIso

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

    Permalink

    compose a PLens with a PLens

    compose a PLens with a PLens

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

    Permalink

    compose a PLens with an POptional

    compose a PLens with an POptional

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

    Permalink

    compose a PLens with a PPrism

    compose a PLens with a PPrism

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

    Permalink

    compose a PLens with a PSetter

    compose a PLens with a PSetter

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

    Permalink

    compose a PLens with a PTraversal

    compose a PLens with a PTraversal

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

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

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

    Permalink

    check if the target satisfies the predicate

    check if the target satisfies the predicate

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

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

    Permalink

    find if the target satisfies the predicate

    find if the target satisfies the predicate

    Annotations
    @inline()
  30. final def first[C]: PLens[(S, C), (T, C), (A, C), (B, C)]

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

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

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

    Permalink
    Definition Classes
    Any
  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  37. final def second[C]: PLens[(C, S), (C, T), (C, A), (C, B)]

    Permalink
    Annotations
    @inline()
  38. final def split[S1, T1, A1, B1](other: PLens[S1, T1, A1, B1]): PLens[(S, S1), (T, T1), (A, A1), (B, B1)]

    Permalink

    pair two disjoint PLens

    pair two disjoint PLens

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

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

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

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

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

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

Deprecated Value Members

  1. final def product[S1, T1, A1, B1](other: PLens[S1, T1, A1, B1]): PLens[(S, S1), (T, T1), (A, A1), (B, B1)]

    Permalink
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 1.2.0) use split

  2. final def sum[S1, T1](other: PLens[S1, T1, A, B]): PLens[\/[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