eu.timepit.refined.api

RefType

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

Type class that allows F to be used as carrier type of a refinement. The first type parameter of F is the base 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
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RefType
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def unsafeRewrap[T, A, B](ta: F[T, A]): F[T, B]

  2. abstract def unsafeRewrapM[T, A, B](c: Context)(ta: macrocompat.CompatContext.Expr[F[T, A]])(implicit arg0: macrocompat.CompatContext.WeakTypeTag[T], arg1: macrocompat.CompatContext.WeakTypeTag[A], arg2: macrocompat.CompatContext.WeakTypeTag[B]): macrocompat.CompatContext.Expr[F[T, B]]

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

  4. abstract def unsafeWrapM[T, P](c: Context)(t: macrocompat.CompatContext.Expr[T])(implicit arg0: macrocompat.CompatContext.WeakTypeTag[T], arg1: macrocompat.CompatContext.WeakTypeTag[P]): macrocompat.CompatContext.Expr[F[T, P]]

  5. abstract def unwrap[T](tp: F[T, _]): T

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def coflatMapRefine[T, P, U](tp: F[T, P])(f: (F[T, P]) ⇒ U)(implicit v: Validate[U, P]): Either[String, F[U, P]]

  9. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Definition Classes
    Any
  15. def mapRefine[T, P, U](tp: F[T, P])(f: (T) ⇒ U)(implicit v: Validate[U, P]): Either[String, F[U, P]]

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. def refine[P]: RefinePartiallyApplied[F, P]

    Returns a value of type T refined as 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 refined as 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.api.{ Refined, RefType }
         | import eu.timepit.refined.numeric.Positive
    
    scala> RefType[Refined].refine[Positive](10)
    res0: Either[String, Refined[Int, Positive]] = Right(10)

    Note: The return type is internal.RefinePartiallyApplied[F, P], which has an apply method on it, allowing the type T to be inferred from its argument.

  20. def refineM[P]: RefineMPartiallyApplied[F, P]

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

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

    Example:

    scala> import eu.timepit.refined.api.{ Refined, RefType }
         | import eu.timepit.refined.numeric.Positive
    
    scala> RefType[Refined].refineM[Positive](10)
    res0: Refined[Int, Positive] = 10

    Note: M stands for macro.

    Note: The return type is internal.RefineMPartiallyApplied[F, P], which has an apply method on it, allowing the type T to be inferred from its argument.

  21. def refineMF[T, P]: RefineMFullyApplied[F, T, P]

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

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

    Example:

    scala> import eu.timepit.refined.api.{ Refined, RefType }
         | import eu.timepit.refined.numeric.Positive
    
    scala> RefType[Refined].refineMF[Long, Positive](10)
    res0: Refined[Long, Positive] = 10

    Note: M stands for macro and F for fully applied.

    Note: The return type is internal.RefineMFullyApplied[F, T, P], which has an apply method on it, allowing refineMF to be called like in the given example. In contrast to refineM, the type T needs to be specified before apply can be called.

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

    Definition Classes
    AnyRef
  23. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped