trait Lens[Container, A] extends Serializable
- Alphabetic
- By Inheritance
- Lens
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def get(c: Container): A
get knows how to extract some field of type
A
from a container - abstract def set(a: A): Mutation[Container]
Represents an assignment operator.
Represents an assignment operator.
Given a value of type A, sets knows how to transform a container such that
a
is assigned to the field.We must have get(set(a)(c)) == a
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def :=(a: A): Mutation[Container]
alias to set
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[B](other: Lens[A, B]): Lens[Container, B]
Composes two lenses, this enables nesting.
Composes two lenses, this enables nesting.
If our field of type A has a sub-field of type B, then given a lens for it (other: Lens[A, B]) we can create a single lens from Container to B.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def modify(f: (A) => A): Mutation[Container]
Represent an update operator (like x.y += 1 )
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def setIfDefined(aOpt: Option[A]): Mutation[Container]
Optional assignment.
Optional assignment.
Given a
Some[A]
, assign theSome
's value to the field. GivenNone
, the container is unchanged. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def zip[B](other: Lens[Container, B]): Lens[Container, (A, B)]
Given two lenses with the same origin, returns a new lens that can mutate both values represented by both lenses through a tuple.