Object

eu.timepit.refined

numeric

Related Doc: package refined

Permalink

object numeric extends NumericValidate with NumericInference

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:

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
Source
numeric.scala
Linear Supertypes
NumericInference, NumericValidate, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. numeric
  2. NumericInference
  3. NumericValidate
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class Greater[N](n: N) extends Product with Serializable

    Permalink

    Predicate that checks if a numeric value is greater than N.

  2. type GreaterEqual[N] = Not[Less[N]]

    Permalink

    Predicate that checks if a numeric value is greater than or equal to N.

  3. type Interval[L, H] = And[GreaterEqual[L], LessEqual[H]]

    Permalink

    Predicate that checks if a numeric value is in the interval [L, H].

  4. case class Less[N](n: N) extends Product with Serializable

    Permalink

    Predicate that checks if a numeric value is less than N.

  5. type LessEqual[N] = Not[Greater[N]]

    Permalink

    Predicate that checks if a numeric value is less than or equal to N.

  6. type Negative = Less[_0]

    Permalink

    Predicate that checks if a numeric value is negative (< 0).

  7. type NonNegative = Not[Negative]

    Permalink

    Predicate that checks if a numeric value is zero or positive (>= 0).

  8. type NonPositive = Not[Positive]

    Permalink

    Predicate that checks if a numeric value is zero or negative (<= 0).

  9. type Positive = Greater[_0]

    Permalink

    Predicate that checks if a numeric value is positive (> 0).

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. implicit def greaterInferenceNat[A <: Nat, B <: Nat](implicit ta: ToInt[A], tb: ToInt[B]): ==>[Greater[A], Greater[B]]

    Permalink
    Definition Classes
    NumericInference
  11. implicit def greaterInferenceWit[C, A <: C, B <: C](implicit wa: Aux[A], wb: Aux[B], nc: Numeric[C]): ==>[Greater[A], Greater[B]]

    Permalink
    Definition Classes
    NumericInference
  12. implicit def greaterInferenceWitNat[C, A <: C, B <: Nat](implicit wa: Aux[A], tb: ToInt[B], nc: Numeric[C]): ==>[Greater[A], Greater[B]]

    Permalink
    Definition Classes
    NumericInference
  13. implicit def greaterValidateNat[N <: Nat, T](implicit tn: ToInt[N], wn: Aux[N], nt: Numeric[T]): Plain[T, Greater[N]]

    Permalink
    Definition Classes
    NumericValidate
  14. implicit def greaterValidateWit[T, N <: T](implicit wn: Aux[N], nt: Numeric[T]): Plain[T, Greater[N]]

    Permalink
    Definition Classes
    NumericValidate
  15. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  17. implicit def lessInferenceNat[A <: Nat, B <: Nat](implicit ta: ToInt[A], tb: ToInt[B]): ==>[Less[A], Less[B]]

    Permalink
    Definition Classes
    NumericInference
  18. implicit def lessInferenceWit[C, A <: C, B <: C](implicit wa: Aux[A], wb: Aux[B], nc: Numeric[C]): ==>[Less[A], Less[B]]

    Permalink
    Definition Classes
    NumericInference
  19. implicit def lessInferenceWitNat[C, A <: C, B <: Nat](implicit wa: Aux[A], tb: ToInt[B], nc: Numeric[C]): ==>[Less[A], Less[B]]

    Permalink
    Definition Classes
    NumericInference
  20. implicit def lessValidateNat[N <: Nat, T](implicit tn: ToInt[N], wn: Aux[N], nt: Numeric[T]): Plain[T, Less[N]]

    Permalink
    Definition Classes
    NumericValidate
  21. implicit def lessValidateWit[T, N <: T](implicit wn: Aux[N], nt: Numeric[T]): Plain[T, Less[N]]

    Permalink
    Definition Classes
    NumericValidate
  22. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from NumericInference

Inherited from NumericValidate

Inherited from AnyRef

Inherited from Any

Ungrouped