Prism

smithy4s.optics.Prism
See thePrism companion object
trait Prism[S, A] extends Optional[S, A]

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

Attributes

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

Members list

Value members

Abstract methods

def inject(a: A): S

Returns an S given an A

Returns an S given an A

Attributes

def project(s: S): Option[A]

Returns a Some of A from S if it is able to obtain an A. Else returns None.

Returns a Some of A from S if it is able to obtain an A. Else returns None.

Attributes

Concrete methods

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

Compose this Prism with another Prism.

Compose this Prism with another Prism.

Attributes

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

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

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

Attributes

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

Provides a function to replace the target of the Prism

Provides a function to replace the target of the Prism

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]): Prism[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