NewsubtypeValidated

monix.newtypes.NewsubtypeValidated
abstract class NewsubtypeValidated[Src] extends Newsubtype[Src]

A validated Newsubtype.

This class is for defining newsubtypes with a builder that validates values.

Example:

 type EmailAddress = EmailAddress.Type

 object EmailAddress extends NewsubtypeValidated[String] {
   def apply(v: String): Either[BuildFailure[Type], Type] =
     if (v.contains("@"))
       Right(unsafeCoerce(v))
     else
       Left(BuildFailure[EmailAddress]("missing @"))
 }

Attributes

Source
NewValidated.scala
Graph
Supertypes
class Newsubtype[Src]
class Object
trait Matchable
class Any

Members list

Type members

Inherited and Abstract types

override opaque type Type

Attributes

Inherited from:
NewsubtypeTrait (hidden)
Source
NewEncoding.scala

Value members

Inherited methods

final inline protected def derive[F[_]](implicit ev: F[Src]): F[Type]

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.scala
final def unapply[A](a: A)(implicit ev: A =:= Type): Some[Src]

Attributes

Inherited from:
NewValidated (hidden)
Source
NewValidated.scala
final def unsafe(value: Src): Type

Attributes

Inherited from:
NewValidated (hidden)
Source
NewValidated.scala
final inline protected def unsafeCoerce(value: Src): Type

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.scala

Inherited and Abstract methods

def apply(value: Src): Either[BuildFailure[Type], Type]

Attributes

Inherited from:
NewValidated (hidden)
Source
NewValidated.scala

Extensions

Inherited extensions

extension (self: Type)
final inline def value: Src

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.scala

Implicits

Inherited implicits

final implicit val builder: Aux[Type, Src]

Attributes

Inherited from:
NewValidated (hidden)
Source
NewValidated.scala
implicit val codec: Aux[Type, Src]

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.scala
implicit val typeInfo: TypeInfo[Type]

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.scala