scalaz

LensFamily

sealed trait LensFamily[-A1, +A2, +B1, -B2] extends AnyRef

A Lens Family, offering a purely functional means to access and retrieve a field transitioning from type B1 to type B2 in a record simultaneously transitioning from type A1 to type A2. scalaz.Lens is a convenient alias for when F =:= Id, A1 =:= A2, and B1 =:= B2.

The term field should not be interpreted restrictively to mean a member of a class. For example, a lens family can address membership of a Set.

A1

The initial type of the record

A2

The final type of the record

B1

The initial type of the field

B2

The final type of the field

Source
Lens.scala
See also

scalaz.PLens

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

Type Members

  1. trait LensLaw extends AnyRef

Abstract Value Members

  1. abstract def run(a: A1): IndexedStore[B1, B2, A2]

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def %%=[C](s: IndexedState[B1, B2, C]): IndexedState[A1, A2, C]

  5. def %=[B <: B2](f: (B1) ⇒ B): IndexedState[A1, A2, B]

    Modify the portion of the state viewed through the lens and return its new value.

  6. def %==(f: (B1) ⇒ B2): IndexedState[A1, A2, Unit]

    Modify the portion of the state viewed through the lens, but do not return its new value.

  7. def ***[C1, C2, D1, D2](that: LensFamily[C1, C2, D1, D2]): LensFamily[(A1, C1), (A2, C2), (B1, D1), (B2, D2)]

    alias for product

  8. def ->>-[C, X1 <: A1, X2 >: A2](f: ⇒ IndexedState[X1, X2, C]): IndexedState[X1, X2, C]

    Sequence the monadic action of looking through the lens to occur before the state action f.

  9. def :=[B <: B2](b: ⇒ B): IndexedState[A1, A2, B]

    Set the portion of the state viewed through the lens and return its new value.

  10. def <%=(f: (B1) ⇒ B2): IndexedState[A1, A2, B1]

    Modify the portion of the state viewed through the lens and return its old value.

    Modify the portion of the state viewed through the lens and return its old value. alias for modo

    Since

    7.0.2

  11. def <:=(b: ⇒ B2): IndexedState[A1, A2, B1]

    Set the portion of the state viewed through the lens and return its old value.

    Set the portion of the state viewed through the lens and return its old value. alias for assigno

    Since

    7.0.2

  12. def <=<[C1, C2](that: LensFamily[C1, C2, A1, A2]): LensFamily[C1, C2, B1, B2]

    alias for compose

  13. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  15. def =>=(f: (B1) ⇒ B2): (A1) ⇒ A2

  16. def =>>=[X[+_]](f: (B1) ⇒ X[B2])(implicit XF: Functor[X]): (A1) ⇒ X[A2]

  17. def >-[C, A <: A1](f: (B1) ⇒ C): State[A, C]

    Map the function f over the value under the lens, as a state action.

  18. def >=>[C1, C2](that: LensFamily[B1, B2, C1, C2]): LensFamily[A1, A2, C1, C2]

    alias for andThen

  19. def >>-[C, X1 <: A1, X2 >: A2](f: (B1) ⇒ IndexedState[X1, X2, C]): IndexedState[X1, X2, C]

    Bind the function f over the value under the lens, as a state action.

  20. def andThen[C1, C2](that: LensFamily[B1, B2, C1, C2]): LensFamily[A1, A2, C1, C2]

  21. def apply(a: A1): IndexedStore[B1, B2, A2]

  22. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  23. def assign[B <: B2](b: ⇒ B): IndexedState[A1, A2, B]

    Set the portion of the state viewed through the lens and return its new value.

  24. def assigno(b: ⇒ B2): IndexedState[A1, A2, B1]

    Set the portion of the state viewed through the lens and return its old value.

    Set the portion of the state viewed through the lens and return its old value.

    Since

    7.0.2

  25. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def compose[C1, C2](that: LensFamily[C1, C2, A1, A2]): LensFamily[C1, C2, B1, B2]

    Lenses can be composed

  27. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def flatMap[C, X1 <: A1, X2 >: A2](f: (B1) ⇒ IndexedState[X1, X2, C]): IndexedState[X1, X2, C]

    Bind the function f over the value under the lens, as a state action.

  31. def get(a: A1): B1

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

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

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

    Definition Classes
    Any
  35. def lensLaw: LensLaw

  36. def lifts[C](s: IndexedState[B1, B2, C]): IndexedState[A1, A2, C]

    Contravariantly map a state action through a lens.

  37. def liftsNT: ~>[[+x]IndexedStateT[[+X]X, B1, B2, x], [+x]IndexedStateT[[+X]X, A1, A2, x]]

    Contravariantly mapping the state of a state monad through a lens is a natural transformation

  38. def map[C, A <: A1](f: (B1) ⇒ C): State[A, C]

    Map the function f over the lens as a state action.

  39. def mod(f: (B1) ⇒ B2, a: A1): A2

    Modify the value viewed through the lens

  40. def modf[X[+_]](f: (B1) ⇒ X[B2], a: A1)(implicit XF: Functor[X]): X[A2]

    Modify the value viewed through the lens, returning a functor X full of results.

  41. def modo(f: (B1) ⇒ B2): IndexedState[A1, A2, B1]

    Modify the portion of the state viewed through the lens and return its old value.

    Modify the portion of the state viewed through the lens and return its old value.

    Since

    7.0.2

  42. def modp[C](f: (B1) ⇒ (B2, C), a: A1): (A2, C)

    Modify the value viewed through the lens, returning a C on the side.

  43. def mods[B <: B2](f: (B1) ⇒ B): IndexedState[A1, A2, B]

    Modify the portion of the state viewed through the lens and return its new value.

  44. def mods_(f: (B1) ⇒ B2): IndexedState[A1, A2, Unit]

    Modify the portion of the state viewed through the lens, but do not return its new value.

  45. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  48. def partial: PLensFamily[A1, A2, B1, B2]

    A homomorphism of lens categories

  49. def product[C1, C2, D1, D2](that: LensFamily[C1, C2, D1, D2]): LensFamily[(A1, C1), (A2, C2), (B1, D1), (B2, D2)]

    Two disjoint lenses can be paired

  50. def set(a: A1, b: B2): A2

  51. def st[A <: A1]: State[A, B1]

  52. def sum[C1, C2, B1m >: B1, B2m <: B2](that: ⇒ LensFamily[C1, C2, B1m, B2m]): LensFamily[\/[A1, C1], \/[A2, C2], B1m, B2m]

    Two lenses that view a value of the same type can be joined

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

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def unary_~: PLensFamily[A1, A2, B1, B2]

    alias for partial

  56. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. def xmapA[X1, X2](f: (A2) ⇒ X2)(g: (X1) ⇒ A1): LensFamily[X1, X2, B1, B2]

  60. def xmapB[X1, X2](f: (B1) ⇒ X1)(g: (X2) ⇒ B2): LensFamily[A1, A2, X1, X2]

  61. def xmapbA[X, A >: A2 <: A1](b: BijectionT.Bijection[A, X]): LensFamily[X, X, B1, B2]

  62. def xmapbB[X, B >: B1 <: B2](b: BijectionT.Bijection[B, X]): LensFamily[A1, A2, X, X]

  63. def |||[C1, C2, A1m <: A1, A2m >: A2, B1m >: B1, B2m <: B2](that: ⇒ LensFamily[C1, C2, B1m, B2m]): LensFamily[\/[A1, C1], \/[A2, C2], B1m, B2m]

    Alias for sum

Inherited from AnyRef

Inherited from Any

Ungrouped