Package

eu.timepit.refined

api

Permalink

package api

Visibility
  1. Public
  2. All

Type Members

  1. final case class Failed[A](detail: A) extends Result[A] with Product with Serializable

    Permalink
  2. case class Inference[P, C](isValid: Boolean, show: String) extends Product with Serializable

    Permalink

    Evidence that states if the conclusion C can be inferred from the premise P or not.

    Evidence that states if the conclusion C can be inferred from the premise P or not.

    This type class is used to implement refinement subtyping. If a valid Inference[P, C] exists, the type F[T, P] is considered a subtype of F[T, C].

  3. trait LowPriorityMaxInstances extends AnyRef

    Permalink
  4. trait LowPriorityMinInstances extends AnyRef

    Permalink
  5. trait Max[T] extends AnyRef

    Permalink

    Type class defining the maximum value of a given type

  6. trait MaxInstances extends LowPriorityMaxInstances

    Permalink
  7. trait Min[T] extends AnyRef

    Permalink

    Type class defining the minimum value of a given type

  8. trait MinInstances extends LowPriorityMinInstances

    Permalink
  9. final case class Passed[A](detail: A) extends Result[A] with Product with Serializable

    Permalink
  10. trait RefType[F[_, _]] extends Serializable

    Permalink

    Type class that allows F to be used as carrier type of a refinement.

    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

    • the Refined value class
    • and shapeless.tag.@@ which is a subtype of its first parameter (i.e. (T @@ P) <: T)
  11. final class Refined[T, P] extends AnyVal with Serializable

    Permalink

    Wraps a value of type T that satisfies the predicate P.

    Wraps a value of type T that satisfies the predicate P. Instances of this class can be created with refineV and refineMV which verify that the wrapped value satisfies P.

  12. trait RefinedType[FTP] extends Serializable

    Permalink

    Type class that combines RefType and Validate instances for a refined type FTP.

  13. class RefinedTypeOps[FTP, T] extends Serializable

    Permalink

    Provides functions to create values of the refined type FTP from values of the base type T.

    Provides functions to create values of the refined type FTP from values of the base type T. It is intended to simplify the definition of a refined type's companion object.

    Example:

    scala> import eu.timepit.refined.api.{ Refined, RefinedTypeOps }
         | import eu.timepit.refined.numeric.Positive
    
    scala> type PosInt = Int Refined Positive
    
    scala> object PosInt extends RefinedTypeOps[PosInt, Int]
    
    scala> PosInt(1)
    res0: PosInt = 1
    
    scala> PosInt.from(2)
    res1: Either[String, PosInt] = Right(2)
  14. sealed abstract class Result[A] extends Product with Serializable

    Permalink
  15. trait Validate[T, P] extends Serializable

    Permalink

    Type class for validating values of type T according to a type-level predicate P.

    Type class for validating values of type T according to a type-level predicate P. The semantics of P are defined by the instance(s) of this type class for P.

Value Members

  1. object Inference extends Serializable

    Permalink
  2. object Max extends MaxInstances

    Permalink
  3. object Min extends MinInstances

    Permalink
  4. object RefType extends Serializable

    Permalink
  5. object Refined extends Serializable

    Permalink
  6. object RefinedType extends Serializable

    Permalink
  7. object RefinedTypeOps extends Serializable

    Permalink
  8. object Result extends Serializable

    Permalink
  9. object Validate extends Serializable

    Permalink

Ungrouped