Validation

trait Validation[Raw]

Module that can define a newtype together with validation logic

All instances of this trait anywhere in the codebase can be retrieved given a Valid type via the Validation.Of typeclass

Companion
object
class Object
trait Matchable
class Any
class FromPredicate0[Raw]
class FromPredicate[Raw]
class EqualsTo[A]

Type members

Classlikes

final case class Error(raw: Raw) extends ValidationError

Types

opaque type Valid

Value members

Abstract methods

def validateWith[A](raw: Raw, handleSuccess: Valid => A, handleError: Error => A): A

Concrete methods

final def unapply(raw: Raw): Option[Valid]
final def validate(raw: Raw): Error | Valid
final def validateEither(raw: Raw): Either[Error, Valid]

Givens

Givens

given given_FromString_Valid(using val Raw: FromString[Raw]): FromString[Valid]