Class/Object

scalaz

LensFamily

Related Docs: object LensFamily | package scalaz

Permalink

sealed abstract class 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 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
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LensFamily
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait LensLaw extends AnyRef

    Permalink

Abstract Value Members

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

    Permalink

Concrete Value Members

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

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

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    alias for product

  7. def ->>-[C](f: ⇒ IndexedState[A1, A2, C]): IndexedState[A1, A2, C]

    Permalink

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

  8. def :=(b: ⇒ B2): IndexedState[A1, A2, B2]

    Permalink

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

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

    Permalink

    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

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

    Permalink

    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

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

    Permalink

    alias for compose

  12. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def =>=(f: (B1) ⇒ B2): (A1) ⇒ A2

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

    Permalink
  15. def >-[C](f: (B1) ⇒ C): State[A1, C]

    Permalink

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

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

    Permalink

    alias for andThen

  17. def >>-[C](f: (B1) ⇒ IndexedState[A1, A2, C]): IndexedState[A1, A2, C]

    Permalink

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

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

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

    Permalink
  20. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  21. def assign(b: ⇒ B2): IndexedState[A1, A2, B2]

    Permalink

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

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

    Permalink

    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

  23. def clone(): AnyRef

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

    Permalink

    Lenses can be composed

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

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

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

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

    Permalink

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

  29. def get(a: A1): B1

    Permalink
  30. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  33. def lensLaw: LensLaw

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

    Permalink

    Contravariantly map a state action through a lens.

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

    Permalink

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

  36. def map[C](f: (B1) ⇒ C): State[A1, C]

    Permalink

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

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

    Permalink

    Modify the value viewed through the lens

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

    Permalink

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

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

    Permalink

    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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

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

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

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

    Permalink

    A homomorphism of lens categories

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

    Permalink

    Two disjoint lenses can be paired

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

    Permalink
  49. def st: State[A1, B1]

    Permalink
  50. def sum[C1, C2](that: ⇒ LensFamily[C1, C2, B1, B2]): LensFamily[\/[A1, C1], \/[A2, C2], B1, B2]

    Permalink

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

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

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

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

    Permalink

    alias for partial

  54. final def wait(): Unit

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

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

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

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

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

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

    Permalink
  61. def |||[C1, C2](that: ⇒ LensFamily[C1, C2, B1, B2]): LensFamily[\/[A1, C1], \/[A2, C2], B1, B2]

    Permalink

    Alias for sum

Inherited from AnyRef

Inherited from Any

Ungrouped