Newsubtype

monix.newtypes.Newsubtype
abstract class Newsubtype[Src]

Like Newtype, except as a subtype of the underlying type instead of as an entirely new type.

 type Level = Level.Type
 object Level extends NewsubtypeWrapped[Int]

 val level1: Level = Level(1)
 // This works too
 val level2: Int = Level(2)
 // This fails compilation
 // val level3: Level = 3

Attributes

Source
Newsubtype.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class NewsubtypeValidated[Src]
class NewsubtypeWrapped[Src]

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 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

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