Lens

object Lens extends CompatLensImplicits
Companion:
class
class Object
trait Matchable
class Any
Lens.type

Type members

Classlikes

final implicit class MapLens[U, A, B](val lens: Lens[U, Map[A, B]]) extends AnyVal

Implicit that adds some syntactic sugar if our lens watches a Map[_, _].

Implicit that adds some syntactic sugar if our lens watches a Map[_, _].

final implicit class OptLens[U, A](val lens: Lens[U, Option[A]]) extends AnyVal

Implicit that adds some syntactic sugar if our lens watches an Option[_].

Implicit that adds some syntactic sugar if our lens watches an Option[_].

Value members

Concrete methods

def apply[Container, A](getter: Container => A)(setter: (Container, A) => Container): Lens[Container, A]
def unit[U]: Lens[U, U]

This is the unit lens, with respect to the compose operation defined above. That is, len.compose(unit) == len == unit.compose(len)

This is the unit lens, with respect to the compose operation defined above. That is, len.compose(unit) == len == unit.compose(len)

More practically, you can view it as a len that mutates the entire object, instead of just a field of it: get() gives the original object, and set() returns the assigned value, no matter what the original value was.

Implicits

Implicits

final implicit def MapLens[U, A, B](lens: Lens[U, Map[A, B]]): MapLens[U, A, B]

Implicit that adds some syntactic sugar if our lens watches a Map[_, _].

Implicit that adds some syntactic sugar if our lens watches a Map[_, _].

final implicit def OptLens[U, A](lens: Lens[U, Option[A]]): OptLens[U, A]

Implicit that adds some syntactic sugar if our lens watches an Option[_].

Implicit that adds some syntactic sugar if our lens watches an Option[_].

Inherited implicits

implicit def seqLikeLens[U, A, CC <: (SeqOps)](lens: Lens[U, CC[A]]): SeqLikeLens[U, A, CC]
Inherited from:
CompatLensImplicits
implicit def setLens[U, A, CC <: (SetOps)](lens: Lens[U, CC[A]]): SetLens[U, A, CC]
Inherited from:
CompatLensImplicits