Package

eu.timepit

refined

Permalink

package refined

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. refined
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class InferenceRule[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.

  2. trait Predicate[P, T] 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.

  3. final case class Refined[T, P](get: T) extends AnyVal with Product with Serializable

    Permalink

Value Members

  1. object InferenceRule extends Serializable

    Permalink
  2. object Predicate extends Serializable

    Permalink
  3. val W: Witness.type

    Permalink

    An abbreviation for shapeless.Witness.

  4. object boolean extends BooleanPredicates with BooleanInferenceRules0

    Permalink
  5. object char extends CharPredicates

    Permalink
  6. object collection extends CollectionPredicates with CollectionInferenceRules

    Permalink
  7. object generic extends GenericPredicates with GenericInferenceRules

    Permalink
  8. object implicits

    Permalink
  9. package internal

    Permalink
  10. object numeric extends NumericPredicates with NumericInferenceRules

    Permalink

    Module for numeric predicates.

    Module for numeric predicates. Predicates that take type parameters support both shapeless' natural numbers (Nat) and numeric singleton types (which are made available by shapeless' Witness - abbreviated as W in refined) which include subtypes of Int, Long, Double, Char etc.

    Example:
    1. scala> import shapeless.nat._
           | import shapeless.tag.@@
           | import eu.timepit.refined.numeric._
      scala> refineMT[Greater[_5]](10)
      res1: Int @@ Greater[_5] = 10
      scala> refineMT[Greater[W.`1.5`.T]](1.6)
      res2: Double @@ Greater[W.`1.5`.T] = 1.6
  11. def refineMT[P]: RefineM[P, @@]

    Permalink

    Macro that returns t with type T @@ P if it satisfies the predicate P, or fails to compile.

    Macro that returns t with type T @@ P if it satisfies the predicate P, or fails to compile.

    Example:
    1. scala> import eu.timepit.refined._
           | import eu.timepit.refined.numeric._
           | import shapeless.tag.@@
      scala> refineMT[Positive](10)
      res1: Int @@ Positive = 10
    Note

    The return type is internal.RefineM[P, @@], which has an apply method on it, allowing refineMT to be called like in the given example.

  12. def refineMV[P]: RefineM[P, Refined]

    Permalink

    Macro that returns t wrapped in Refined[T, P] if it satisfies the predicate P, or fails to compile.

    Macro that returns t wrapped in Refined[T, P] if it satisfies the predicate P, or fails to compile.

    Example:
    1. scala> import eu.timepit.refined._
           | import eu.timepit.refined.numeric._
      scala> refineMV[Positive](10)
      res1: Refined[Int, Positive] = Refined(10)
    Note

    The return type is internal.RefineM[P, Refined], which has an apply method on it, allowing refineMV to be called like in the given example.

  13. def refineT[P]: Refine[P, @@]

    Permalink

    Returns t with type T @@ P on the right if it satisfies the predicate P, or an error message on the left otherwise.

    Returns t with type T @@ P on the right if it satisfies the predicate P, or an error message on the left otherwise.

    Example:
    1. scala> import eu.timepit.refined._
           | import eu.timepit.refined.numeric._
           | import shapeless.tag.@@
      scala> refineT[Positive](10)
      res1: Either[String, Int @@ Positive] = Right(10)
    Note

    The return type is internal.Refine[P, @@], which has an apply method on it, allowing refineT to be called like in the given example.

  14. def refineV[P]: Refine[P, Refined]

    Permalink

    Returns t wrapped in Refined[T, P] on the right if it satisfies the predicate P, or an error message on the left otherwise.

    Returns t wrapped in Refined[T, P] on the right if it satisfies the predicate P, or an error message on the left otherwise.

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

    The return type is internal.Refine[P, Refined], which has an apply method on it, allowing refineV to be called like in the given example.

  15. object string extends StringPredicates with StringInferenceRules

    Permalink
  16. package util

    Permalink

Deprecated Value Members

  1. def refine[P]: Refine[P, @@]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0) refine is deprecated in favor of refineT

  2. def refineLit[P]: RefineM[P, @@]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0) refineLit is deprecated in favor of refineMT

  3. def refineM[P]: RefineM[P, Refined]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0) refineM is deprecated in favor of refineMV

Inherited from AnyRef

Inherited from Any

Ungrouped