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 unchecked(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 contramap[A0](f: A0 => A): Aux[Constraint, A0, B]
final def map[B0](f: B => B0): Aux[Constraint, A, B0]

Concrete fields

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