BooleanOps

zio.blocks.schema.SchemaExpr.BooleanOps
final implicit class BooleanOps[A, B](self: SchemaExpr[A, B]) extends AnyVal

Logical combinators for boolean SchemaExprs.

Provided as an implicit class rather than direct methods on SchemaExpr so that downstream libraries can supply their own implicit class with &&/|| overloads for a different result type (e.g. a DDB-specific or SQL-specific expression ADT).

In Scala 2, a direct method found by name suppresses implicit receiver views even when the argument type does not match (SLS ยง7.3). Moving &&/|| here lifts that suppression: when a downstream library brings in its own ops class via an explicit import, that import-scope implicit takes priority over this companion-scope implicit (Scala 2 implicit priority: local/import

companion), so the downstream overload wins for se && downstreamValue without ambiguity in that context.

Note: two companion-scope implicits providing &&/|| would still be ambiguous for se && se2. Downstream libraries should introduce their ops via explicit import (or a user-facing object) rather than a companion to avoid that scenario.

Attributes

Source
SchemaExpr.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def &&(that: SchemaExpr[A, Boolean])(implicit ev: B <:< Boolean): SchemaExpr[A, Boolean]

Attributes

Source
SchemaExpr.scala
def and(that: SchemaExpr[A, Boolean])(implicit ev: B <:< Boolean): SchemaExpr[A, Boolean]

Attributes

Source
SchemaExpr.scala
def or(that: SchemaExpr[A, Boolean])(implicit ev: B <:< Boolean): SchemaExpr[A, Boolean]

Attributes

Source
SchemaExpr.scala
def ||(that: SchemaExpr[A, Boolean])(implicit ev: B <:< Boolean): SchemaExpr[A, Boolean]

Attributes

Source
SchemaExpr.scala