Trait/Object

eu.timepit.refined

RefType

Related Docs: object RefType | package refined

Permalink

trait RefType[F[_, _]] extends Serializable

Type class that allows F to be used as result type of a refinement. The first type parameter of F is the type that is being refined by its second type parameter which is the type-level predicate that denotes the refinement. Consequently, F[T, P] is a phantom type that only contains a value of type T.

The library provides instances of RefType for

Source
RefType.scala
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RefType
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def unsafeRewrapM[T, A, B](c: Context)(ta: scala.reflect.macros.blackbox.Context.Expr[F[T, A]])(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[T], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[A], arg2: scala.reflect.macros.blackbox.Context.WeakTypeTag[B]): scala.reflect.macros.blackbox.Context.Expr[F[T, B]]

    Permalink
  2. abstract def unsafeWrap[T, P](t: T): F[T, P]

    Permalink
  3. abstract def unsafeWrapM[T, P](c: Context)(t: scala.reflect.macros.blackbox.Context.Expr[T])(implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[T], arg1: scala.reflect.macros.blackbox.Context.WeakTypeTag[P]): scala.reflect.macros.blackbox.Context.Expr[F[T, P]]

    Permalink
  4. abstract def unwrap[T, P](tp: F[T, P]): T

    Permalink

Concrete 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. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  12. def mapRefine[T, P, U](tp: F[T, P])(f: (T) ⇒ U)(implicit p: Predicate[P, U]): Either[String, F[U, P]]

    Permalink
  13. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  16. def refine[P]: RefineAux[F, P]

    Permalink

    Returns a value of type T wrapped in F[T, P] on the right if it satisfies the predicate P, or an error message on the left otherwise.

    Returns a value of type T wrapped in F[T, P] on the right if it satisfies the predicate P, or an error message on the left otherwise.

    Example:

    scala> import eu.timepit.refined._
         | import eu.timepit.refined.numeric._
    
    scala> RefType[Refined].refine[Positive](10)
    res1: Either[String, Refined[Int, Positive]] = Right(Refined(10))

    Note: The return type is internal.RefineAux[F, P], which has an apply method on it, allowing refine to be called like in the given example.

  17. def refineM[P]: RefineMAux[F, P]

    Permalink

    Macro that returns a value of type T wrapped in F[T, P] if it satisfies the predicate P, or fails to compile otherwise.

    Macro that returns a value of type T wrapped in F[T, P] if it satisfies the predicate P, or fails to compile otherwise.

    Example:

    scala> import eu.timepit.refined._
         | import eu.timepit.refined.numeric._
    
    scala> RefType[Refined].refineM[Positive](10)
    res1: Refined[Int, Positive] = Refined(10)

    Note: M stands for macro.

    Note: The return type is internal.RefineMAux[F, P], which has an apply method on it, allowing refineM to be called like in the given example.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped