← ZIO Prelude docs

Natural

zio.prelude.newtypes.`package`.Natural
object Natural extends Subtype[Int]

Attributes

Source
package.scala
Graph
Supertypes
class Subtype[Int]
class Newtype[Int]
class Object
trait Matchable
class Any
Show all
Self type
Natural.type

Members list

Type members

Inherited and Abstract types

type Type <: Int

Attributes

Inherited from:
Subtype
Source
Subtype.scala

Value members

Concrete methods

inline override def assertion: Assertion[Int]

Attributes

Definition Classes
Source
package.scala
def minus(x: Natural, y: Natural): Natural

Attributes

Source
package.scala
def plus(x: Natural, y: Natural): Natural

Attributes

Source
package.scala

Attributes

Source
package.scala
def times(x: Natural, y: Natural): Natural

Attributes

Source
package.scala

Inherited methods

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

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
inline def apply(inline a1: Int, inline a2: Int, inline a3: Int, inline a4: Int, inline a5: Int): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
inline def apply(inline a1: Int, inline a2: Int, inline a3: Int, inline a4: Int): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
inline def apply(inline a1: Int, inline a2: Int, inline a3: Int): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
inline def apply(inline a1: Int, inline a2: Int): NonEmptyChunk[Type]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
inline def apply(inline a1: Int): 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
Source
Newtype.scala
def derive[TypeClass[_]](implicit instance: TypeClass[Int]): 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
Source
Newtype.scala
def make(value: Int): Validation[String, Type]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
def makeAll[F[_] : ForEach](value: F[Int]): Validation[String, F[Type]]

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala
def unapply(value: Type): Some[Int]

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
Source
Newtype.scala
def unwrap(value: Type): Int

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
Source
Newtype.scala
def unwrapAll[F[_]](value: F[Type]): F[Int]

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
Source
Newtype.scala
protected def validate(value: Int): 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

Inherited from:
Newtype
Source
Newtype.scala
inline protected def validateInline(inline value: Int): 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 from:
Newtype
Source
Newtype.scala
def wrap(value: Int): 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
Source
Newtype.scala
def wrapAll[F[_]](value: F[Int]): 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
Source
Newtype.scala

Concrete fields

val max: Natural

Attributes

Source
package.scala
val one: Natural

Attributes

Source
package.scala
val zero: Natural

Attributes

Source
package.scala

Implicits

Inherited implicits

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

Attributes

Inherited from:
NewtypeCustom
Source
Newtype.scala