Class

zio.prelude.NewtypeExports

SubtypeSmart

Related Doc: package NewtypeExports

Permalink

abstract class SubtypeSmart[A] extends NewtypeModule.SubtypeSmart[A]

The class of objects corresponding to subtypes with smart constructors where not all instances of the underlying type are valid instances of the subtype. Users should implement an object that extends this class to create their own subtypes, specifying A as the underlying type to wrap and an assertion that valid instances of the underlying type should satisfy.

object Natural extends SubtypeSmart[Int](isGreaterThanEqualTo(0))
type Natural = Natural.Type
Linear Supertypes
NewtypeModule.SubtypeSmart[A], NewtypeModule.NewtypeSmart[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SubtypeSmart
  2. SubtypeSmart
  3. NewtypeSmart
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SubtypeSmart(assertion: Assertion[A])

    Permalink

Type Members

  1. trait Tag extends Any

    Permalink
  2. type Type = NewtypeModule.SubtypeSmart.Type with Tag

    Permalink
    Definition Classes
    SubtypeSmart → SubtypeSmart → NewtypeSmart

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(value: A): Type

    Permalink

    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
    protected
    Definition Classes
    NewtypeSmart
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def make(value: A): Validation[String, Type]

    Permalink

    Attempts to convert an instance of the underlying type to an instance of the newtype, returning a Validation containing either a valid instance of the newtype or a string message describing why the instance was invalid.

    Attempts to convert an instance of the underlying type to an instance of the newtype, returning a Validation containing either a valid instance of the newtype or a string message describing why the instance was invalid.

    Definition Classes
    NewtypeSmart
  14. def makeAll[F[+_]](value: F[A])(implicit arg0: ForEach[F]): Validation[String, F[Type]]

    Permalink

    Attempts to convert a collection of instances of the underlying type to a collection of instances of the newtype, returning a Validation containing either a collection of valid instances of the newtype or an accumulation of validation errors.

    Attempts to convert a collection of instances of the underlying type to a collection of instances of the newtype, returning a Validation containing either a collection of valid instances of the newtype or an accumulation of validation errors.

    Definition Classes
    SubtypeSmart → NewtypeSmart
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. val subtype: NewtypeModule.SubtypeSmart[A]

    Permalink
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. def unapply(value: Type): Some[A]

    Permalink

    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.

    Definition Classes
    NewtypeSmart
  22. def unwrap(value: Type): A

    Permalink

    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.

    Definition Classes
    NewtypeSmart
  23. def unwrapAll[F[_]](value: F[Type]): F[A]

    Permalink

    Converts an instance of a type parameterized on the newtype back to an instance of a type parameterized on 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.

    Definition Classes
    SubtypeSmart → NewtypeSmart
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def wrap(value: A): Type

    Permalink

    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
    protected
    Definition Classes
    NewtypeSmart
  28. def wrapAll[F[_]](value: F[A]): F[Type]

    Permalink

    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. For example, this could be used to convert a list of instances of the underlying type to a list of instances of the newtype.

    Attributes
    protected
    Definition Classes
    SubtypeSmart → NewtypeSmart

Inherited from NewtypeModule.SubtypeSmart[A]

Inherited from NewtypeModule.NewtypeSmart[A]

Inherited from AnyRef

Inherited from Any

Ungrouped