Prism

object Prism
class Object
trait Matchable
class Any
Prism.type

Value members

Concrete methods

final def apply[S, A](viewOrModify: S => Either[S, A])(review: A => S): Prism[S, A]

create a polymorphic Prism from a matcher function that produces an Either and a review function

create a polymorphic Prism from a matcher function that produces an Either and a review function

the matcher function returns an Either to allow for type-changing prisms in the case where the input does not match.

final def fromPartial[S, A](preview: PartialFunction[S, A])(review: A => S): Prism[S, A]

create a monomorphic Prism, using a partial function and review functions

create a monomorphic Prism, using a partial function and review functions

final def fromPreview[S, A](preview: S => Option[A])(review: A => S): Prism[S, A]

create a monomorphic Prism, using preview and review functions

create a monomorphic Prism, using preview and review functions

final def id[S]: Prism[S, S]

monomorphic identity of a Prism

monomorphic identity of a Prism

final def nearly[A](a: A)(predicate: A => Boolean)(implicit ev: Alternative[Option]): Prism[A, Unit]

create a monomorphic Prism that checks whether the focus matches a predicate

create a monomorphic Prism that checks whether the focus matches a predicate

final def only[A : Eq](a: A)(implicit evidence$2: Eq[A], ev: Alternative[Option]): Prism[A, Unit]

create a monomorphic Prism that checks whether the focus matches a single value

create a monomorphic Prism that checks whether the focus matches a single value