Refinement

trait Refinement[A, B]

A type-refinement, associated to a runtime-representation of a constraint.

Represents the fact that you can go from A to B provided the value of tye A abides by a given Constraint.

Companion:
object
class Object
trait Matchable
class Any

Type members

Types

The reified constraint associated to the refinement

The reified constraint associated to the refinement

Value members

Abstract methods

def apply(a: A): Either[String, B]
def from(b: B): A
def unsafe(a: A): B

Short circuits validation. This should only be used as last-resort when it is impossible to implement schema compilers otherwise, such as ones that create data out of thin air (random generators/default values/etc).

Short circuits validation. This should only be used as last-resort when it is impossible to implement schema compilers otherwise, such as ones that create data out of thin air (random generators/default values/etc).

Concrete methods

final def imapFull[A0, B0](bijectSource: Bijection[A, A0], bijectTarget: Bijection[B, B0]): Aux[Constraint, A0, B0]

Deprecated methods

@deprecated("use unsafe instead")
def unchecked(a: A): B
Deprecated

Concrete fields

final val asFunction: A => Either[ConstraintError, B]
final val asThrowingFunction: A => B