Lens

smithy4s.optics.Lens
See theLens companion object
trait Lens[S, A] extends Optional[S, A]

Lens implementation which can be used to abstract over accessing/updating a member of a product type

Attributes

Companion
object
Graph
Supertypes
trait Optional[S, A]
class Object
trait Matchable
class Any
Self type
Lens[S, A]

Members list

Value members

Abstract methods

def get(s: S): A

Retrieve the target of the Lens

Retrieve the target of the Lens

Attributes

def replace(a: A): S => S

Provides a function to replace the target of the Lens

Provides a function to replace the target of the Lens

Attributes

Concrete methods

final def andThen[A0](that: Lens[A, A0]): Lens[S, A0]

Compose this Lens with another Lens. The result will be a lens that starts with the source of the first lens and points to the target of the second lens.

Compose this Lens with another Lens. The result will be a lens that starts with the source of the first lens and points to the target of the second lens.

Attributes

final override def modify(f: A => A): S => S

Modify the target of the Lens with a function from A => A

Modify the target of the Lens with a function from A => A

Attributes

Definition Classes
final def project(s: S): Option[A]

Retrieve the target of the Lens as an Optional (implemented to conform to Optional)

Retrieve the target of the Lens as an Optional (implemented to conform to Optional)

Attributes

final override def some[A0](implicit ev1: A =:= Option[A0]): Optional[S, A0]

Allows abstracting over an optional target by pointing to the inside of the optional value (the value inside of the Some).

Allows abstracting over an optional target by pointing to the inside of the optional value (the value inside of the Some).

Attributes

Definition Classes
final override def value[A0](implicit bijection: Bijection[A0, A]): Lens[S, A0]

Helper function for targeting the value inside of a smithy4s.Newtype or other type with an implicit Bijection available.

Helper function for targeting the value inside of a smithy4s.Newtype or other type with an implicit Bijection available.

Attributes

Definition Classes

Inherited methods

final def andThen[A0](that: Optional[A, A0]): Optional[S, A0]

Compose this Optional with another Optional.

Compose this Optional with another Optional.

Attributes

Inherited from:
Optional