NewtypeValidated
monix.newtypes.NewtypeValidated
abstract class NewtypeValidated[Src] extends Newtype[Src]
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 @"))
}
Attributes
- Source
- NewValidated.scala
- Graph
-
- Supertypes
Members list
Type members
Inherited and Abstract types
Attributes
- Inherited from:
- NewtypeTrait (hidden)
- Source
- NewEncoding.scala
Value members
Inherited methods
Attributes
- Inherited from:
- NewEncoding (hidden)
- Source
- NewEncoding.scala
Attributes
- Inherited from:
- NewValidated (hidden)
- Source
- NewValidated.scala
Attributes
- Inherited from:
- NewValidated (hidden)
- Source
- NewValidated.scala
Attributes
- Inherited from:
- NewEncoding (hidden)
- Source
- NewEncoding.scala
Inherited and Abstract methods
Attributes
- Inherited from:
- NewValidated (hidden)
- Source
- NewValidated.scala
Extensions
Inherited extensions
extension (self: Type)
Attributes
- Inherited from:
- NewEncoding (hidden)
- Source
- NewEncoding.scala
Implicits
Inherited implicits
Attributes
- Inherited from:
- NewValidated (hidden)
- Source
- NewValidated.scala
Attributes
- Inherited from:
- NewEncoding (hidden)
- Source
- NewEncoding.scala
Attributes
- Inherited from:
- NewEncoding (hidden)
- Source
- NewEncoding.scala
In this article