Newtype

zio.prelude.Newtype
abstract class Newtype[A] extends NewtypeCustom[A]

Attributes

Graph
Supertypes
class NewtypeCustom[A]
class Object
trait Matchable
class Any
Known subtypes
class Subtype[A]
object And
object Natural
object Or

Members list

Type members

Inherited and Abstract types

type Type

Attributes

Inherited from:
NewtypeCustom

Value members

Concrete methods

protected def validate(value: A): Either[AssertionError, Unit]

Function that will used to check runtime values before lifting them into the newtype. Should be consistent with validateInline.

Function that will used to check runtime values before lifting them into the newtype. Should be consistent with validateInline.

Attributes

inline protected def validateInline(inline value: A): Unit

Function that will be used to check compile-time values before lifting them into the newtype. Should be consistent with validate.

Function that will be used to check compile-time values before lifting them into the newtype. Should be consistent with validate.

Attributes

Inherited methods

inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A, inline a5: A, inline a6: A): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A, inline a5: A): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
inline def apply(inline a1: A, inline a2: A, inline a3: A): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
inline def apply(inline a1: A, inline a2: A): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
inline def apply(inline a1: A): Type

Converts an instance of the underlying type to an instance of the newtype.

Converts an instance of the underlying type to an instance of the newtype.

Attributes

Inherited from:
NewtypeCustom
def derive[TypeClass[_]](implicit instance: TypeClass[A]): TypeClass[Type]

Derives an instance of a type class for the new type given an instance of the type class for the underlying type. The caller is responsible for the type class being a valid instance for the new type.

Derives an instance of a type class for the new type given an instance of the type class for the underlying type. The caller is responsible for the type class being a valid instance for the new type.

Attributes

Inherited from:
NewtypeCustom

Attributes

Inherited from:
NewtypeCustom
def makeAll[F[_] : ForEach](value: F[A]): Validation[String, F[Type]]

Attributes

Inherited from:
NewtypeCustom
def unapply(value: Type): Some[A]

Allows pattern matching on newtype instances to convert them back to instances of the underlying type.

Allows pattern matching on newtype instances to convert them back to instances of the underlying type.

Attributes

Inherited from:
NewtypeCustom
def unwrap(value: Type): A

Converts an instance of the newtype back to an instance of the underlying type.

Converts an instance of the newtype back to an instance of the underlying type.

Attributes

Inherited from:
NewtypeCustom
def unwrapAll[F[_]](value: F[Type]): F[A]

Converts an instance of a type parameterized on the newtype back to an instance of a type parameterized on the underlying type. For example, this could be used to convert a list of instances of the newtype back to a list of instances of the underlying type.

Converts an instance of a type parameterized on the newtype back to an instance of a type parameterized on the underlying type. For example, this could be used to convert a list of instances of the newtype back to a list of instances of the underlying type.

Attributes

Inherited from:
NewtypeCustom
def wrap(value: A): Type

Converts an instance of the underlying type to an instance of the newtype. Ignores the assertion.

Converts an instance of the underlying type to an instance of the newtype. Ignores the assertion.

Attributes

Inherited from:
NewtypeCustom
def wrapAll[F[_]](value: F[A]): F[Type]

Converts an instance of a type parameterized on the underlying type to an instance of a type parameterized on the newtype.

Converts an instance of a type parameterized on the underlying type to an instance of a type parameterized on the newtype.

Attributes

Inherited from:
NewtypeCustom

Implicits

Inherited implicits

implicit def classTag(implicit underlying: ClassTag[A]): ClassTag[Type]

Attributes

Inherited from:
NewtypeCustom