NewtypeValidated
A validated Newtype.
This class is for defining newtypes with a builder that validates values.
Example:
type EmailAddress = EmailAddress.Type
object EmailAddress extends NewtypeValidated[String] {
def apply(v: String): Either[BuildFailure[Type], Type] =
if (v.contains("@"))
Right(unsafeCoerce(v))
else
Left(BuildFailure("missing @"))
}
trait NewValidated[Src]
class Newtype[Src]
trait NewtypeTrait[Src]
trait NewEncoding[Src]
class Object
trait Matchable
class Any
Type members
Inherited types
Value members
Inherited methods
Extensions
Inherited extensions
extension (self: Type)