Refinement

smithy4s.Refinement
See theRefinement companion object
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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Types

The reified constraint associated to the refinement

The reified constraint associated to the refinement

Attributes

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).

Attributes

Concrete methods

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

Concrete fields

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