Variant

zio.blocks.schema.binding.Binding.Variant
See theVariant companion class
object Variant

Variant bindings for Option, Either and Maybe.

Attributes

Companion
class
Source
Binding.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Variant.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 either[A, B]: Variant[Either[A, B]]

The binding of Either[A, B]: Left is case 0 and Right is case 1.

The binding of Either[A, B]: Left is case 0 and Right is case 1.

Type parameters

A

the left value type

B

the right value type

Attributes

Source
Binding.scala
def maybe[A]: Variant[AnyRef]

The binding of a Maybe, used by Reflect.maybe: an absent value is case 0 and a present one is case 1. For an absent value the case 0 matcher returns a private non-null marker object, since null would mean no match; for a present value the case 1 matcher returns the value inside the Maybe. Each returns null otherwise.

The binding of a Maybe, used by Reflect.maybe: an absent value is case 0 and a present one is case 1. For an absent value the case 0 matcher returns a private non-null marker object, since null would mean no match; for a present value the case 1 matcher returns the value inside the Maybe. Each returns null otherwise.

Attributes

Source
Binding.scala
def option[A]: Variant[Option[A]]

The binding of Option[A]: None is case 0 and Some is case 1.

The binding of Option[A]: None is case 0 and Some is case 1.

Attributes

Source
Binding.scala