NewsubtypeWrapped

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

Simple variant of Newsubtype that provides an apply builder.

Such newsubtypes are meant for simple wrappers that don't do any validation.

Usage:

 type FullName = FullName.Type

 object FullName extends NewsubtypeWrapped[String]

 // Initializing
 val name: FullName = FullName("Alexandru Nedelcu")
 // No need to extract the value when a string is needed:
 assert(name === "Alexandru Nedelcu")

 // We can pattern-match too:
 name match {
   case FullName(nameStr) =>
     assert(nameStr === "Alexandru Nedelcu")
 }

Attributes

Source
NewWrapped.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 def apply(x: Src): Type

Attributes

Inherited from:
NewWrapped (hidden)
Source
NewWrapped.scala
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:
NewWrapped (hidden)
Source
NewWrapped.scala
final inline protected def unsafeCoerce(value: Src): Type

Attributes

Inherited from:
NewEncoding (hidden)
Source
NewEncoding.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:
NewWrapped (hidden)
Source
NewWrapped.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