Lens

object Lens extends CompatLensImplicits
Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

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