Prism

zio.blocks.schema.Prism
See thePrism companion trait
object Prism

Constructors for Prism.

Attributes

Companion
trait
Source
Optic.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Prism.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apply[S, A <: S](source: Bound[S], focusTerm: Bound[S, A]): Prism[S, A]

Creates a prism on the case focusTerm of the variant source. The case is looked up by the term's name, so focusTerm must be one of source's cases. If it is not, this method throws ArrayIndexOutOfBoundsException (see docs/dev/issues.md). Reflect.Variant#prismByName and the $ macro of CompanionOptics check the case for you.

Creates a prism on the case focusTerm of the variant source. The case is looked up by the term's name, so focusTerm must be one of source's cases. If it is not, this method throws ArrayIndexOutOfBoundsException (see docs/dev/issues.md). Reflect.Variant#prismByName and the $ macro of CompanionOptics check the case for you.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if source has no case named like focusTerm

java.lang.IllegalArgumentException

if source or focusTerm is null

Source
Optic.scala
def apply[S, T <: S, A <: T](first: Prism[S, T], second: Prism[T, A]): Prism[S, A]

Composes two prisms: the result focuses on the case A of first's case T. It is the same as first(second).

Composes two prisms: the result focuses on the case A of first's case T. It is the same as first(second).

Attributes

Throws
java.lang.IllegalArgumentException

if first or second is null

Source
Optic.scala