Class

zio.prelude.NewtypeFExports

SubtypeSmartF

Related Doc: package NewtypeFExports

Permalink

abstract class SubtypeSmartF[A[_]] extends NewtypeModuleF.SubtypeSmartF[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 ShortList extends SubtypeSmartF[List](isShorterThan(5))
type ShortList = ShortList.Type
Linear Supertypes
NewtypeModuleF.SubtypeSmartF[A], NewtypeModuleF.NewtypeSmartF[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SubtypeSmartF
  2. SubtypeSmartF
  3. NewtypeSmartF
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SubtypeSmartF(assertion: AssertionF[A])

    Permalink

Type Members

  1. type Type[x] = NewtypeModuleF.SubtypeSmartF.Type[x]

    Permalink
    Definition Classes
    SubtypeSmartF → SubtypeSmartF → NewtypeSmartF

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[x](value: A[x]): Type[x]

    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
    NewtypeSmartF
  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[x](value: A[x]): Validation[String, Type[x]]

    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
    NewtypeSmartF
  14. def makeAll[F[+_], x](value: F[A[x]])(implicit arg0: ForEach[F]): Validation[String, F[Type[x]]]

    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
    SubtypeSmartF → NewtypeSmartF
  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 subtypeF: NewtypeModuleF.SubtypeSmartF[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[x](value: Type[x]): Some[A[x]]

    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
    NewtypeSmartF
  22. def unwrap[x](value: Type[x]): A[x]

    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
    NewtypeSmartF
  23. def unwrapAll[F[_], x](value: F[Type[x]]): F[A[x]]

    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
    SubtypeSmartF → NewtypeSmartF
  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[x](value: A[x]): Type[x]

    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
    NewtypeSmartF
  28. def wrapAll[F[_], x](value: F[A[x]]): F[Type[x]]

    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
    SubtypeSmartF → NewtypeSmartF

Inherited from NewtypeModuleF.SubtypeSmartF[A]

Inherited from NewtypeModuleF.NewtypeSmartF[A]

Inherited from AnyRef

Inherited from Any

Ungrouped