scalaz

Lens

case class Lens[A, B](get: (A) ⇒ B, set: (A, B) ⇒ A) extends Immutable with Product with Serializable

Lenses are required to satisfy the following two laws and to be side-effect free.

All instances must satisfy 2 laws:

Linear Supertypes
Serializable, Serializable, Product, scala.Equals, Immutable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Lens
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Immutable
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Lens(get: (A) ⇒ B, set: (A, B) ⇒ A)

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, D](that: Lens[C, D]): Lens[(A, C), (B, D)]

    Two disjoint lenses can be paired

  5. def :=(b: B): State[A, Unit]

    Set the value viewed through the lens to a given value

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

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

    Definition Classes
    Any
  8. def andThen[C](that: Lens[B, C]): Lens[A, C]

  9. def apply(whole: A): B

    A Lens[A,B] can be used as a function from A => B, or implicitly via Lens.

    A Lens[A,B] can be used as a function from A => B, or implicitly via Lens.asState as a State[A,B] action

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def compose[C](that: Lens[C, A]): Lens[C, B]

    Lenses can be composed

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

    Definition Classes
    AnyRef
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def flatMap[C](f: (B) ⇒ State[A, C]): State[A, C]

    flatMapping a lens yields a state action to avoid ambiguity

  16. val get: (A) ⇒ B

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

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

    Definition Classes
    Any
  19. def lifts[C](s: State[B, C]): State[A, C]

    We can contravariantly map the state of a state monad through a lens

  20. def liftsNT: ~>[[X]State[B, X], [X]State[A, X]]

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

  21. def map[C](f: (B) ⇒ C): State[A, C]

    Mapping a lens yields a state action to avoid ambiguity

  22. def mod(a: A, f: (B) ⇒ B): A

    Modify the value viewed through the lens

  23. def modf[F[_]](a: A, f: (B) ⇒ F[B])(implicit arg0: Functor[F]): F[A]

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

  24. def modp[C](a: A, f: (B) ⇒ (B, C)): (A, C)

    modp[C] = modf[PartialApply1Of2[Tuple,C]#Flip], but is more convenient to think about

  25. def modps[C](f: (B) ⇒ (B, C)): State[A, C]

    modify the state, and return a derived value as a state monadic action.

  26. def mods[C](f: (B) ⇒ B): State[A, B]

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

  27. def mods_[C](f: (B) ⇒ B): State[A, Unit]

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

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

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

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

    Definition Classes
    AnyRef
  31. val set: (A, B) ⇒ A

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

    Definition Classes
    AnyRef
  33. implicit def toState: State[A, B]

    A Lens[A,B] can be used directly as a State[A,B] that retrieves the value viewed from the state

  34. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def xmap[C](f: (B) ⇒ C)(g: (C) ⇒ B): Lens[A, C]

    You can apply an isomorphism to the value viewed through the lens to obtain a new lens.

  38. def |||[C](that: Lens[C, B]): Lens[Either[A, C], B]

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from scala.Equals

Inherited from Immutable

Inherited from AnyRef

Inherited from Any

No Group