NewsubtypeWrapped

abstract class NewsubtypeWrapped[Src] extends Newsubtype[Src] with NewWrapped[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")
 }
trait NewWrapped[Src]
class Newsubtype[Src]
trait NewsubtypeTrait[Src]
trait NewEncoding[Src]
class Object
trait Matchable
class Any

Type members

Inherited types

override opaque type Type
Inherited from:
NewsubtypeTrait

Value members

Inherited methods

final def apply(x: Src): Type
Inherited from:
NewWrapped
final inline protected def derive[F[_]](implicit ev: F[Src]): F[Type]
Inherited from:
NewEncoding
final def unapply[A](a: A)(implicit ev: A =:= Type): Some[Src]
Inherited from:
NewWrapped
final inline protected def unsafeCoerce(value: Src): Type
Inherited from:
NewEncoding

Extensions

Inherited extensions

extension (self: Type)
final inline def value: Src
Inherited from:
NewEncoding

Implicits

Inherited implicits

final implicit val builder: Aux[Type, Src]
Inherited from:
NewWrapped
implicit val codec: Aux[Type, Src]
Inherited from:
NewEncoding
implicit val typeInfo: TypeInfo[Type]
Inherited from:
NewEncoding