NewtypeCustom

zio.prelude.NewtypeCustom
abstract class NewtypeCustom[A]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Newtype[A]
class Subtype[A]
object And
object Natural
object Or
class SubtypeCustom[A]
Show all

Members list

Type members

Types

type Type

Value members

Abstract 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

Concrete methods

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

inline def apply(inline a1: A, inline a2: A): NonEmptyChunk[Type]
inline def apply(inline a1: A, inline a2: A, inline a3: A): NonEmptyChunk[Type]
inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A): NonEmptyChunk[Type]
inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A, inline a5: A): NonEmptyChunk[Type]
inline def apply(inline a1: A, inline a2: A, inline a3: A, inline a4: A, inline a5: A, inline a6: A): NonEmptyChunk[Type]
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

def makeAll[F[_] : ForEach](value: F[A]): Validation[String, F[Type]]
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

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

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

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

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

Implicits

Implicits

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