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, Equals, Immutable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  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. def != (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    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. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    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. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  11. def canEqual (arg0: Any): Boolean

    Definition Classes
    Lens → Equals
  12. def clone (): AnyRef

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

    Lenses can be composed

  14. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  15. def equals (arg0: Any): Boolean

    Definition Classes
    Lens → Equals → AnyRef → Any
  16. def finalize (): Unit

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

    flatMapping a lens yields a state action to avoid ambiguity

  18. val get : (A) ⇒ B

  19. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  20. def hashCode (): Int

    Definition Classes
    Lens → AnyRef → Any
  21. def isInstanceOf [T0] : Boolean

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

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

  23. 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

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

    Mapping a lens yields a state action to avoid ambiguity

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

    Modify the value viewed through the lens

  26. 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

  27. 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

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

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

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

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

  30. 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

  31. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  32. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  33. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  34. def productArity : Int

    Definition Classes
    Lens → Product
  35. def productElement (arg0: Int): Any

    Definition Classes
    Lens → Product
  36. def productIterator : Iterator[Any]

    Definition Classes
    Product
  37. def productPrefix : String

    Definition Classes
    Lens → Product
  38. val set : (A, B) ⇒ A

  39. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  40. 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

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

    Attributes
    implicit
  41. def toString (): String

    Definition Classes
    Lens → AnyRef → Any
  42. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. 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.

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

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

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Immutable

Inherited from AnyRef

Inherited from Any