package api
- Alphabetic
- Public
- All
Type Members
- final case class Failed[A](detail: A) extends Result[A] with Product with Serializable
-
case class
Inference[P, C](isValid: Boolean, show: String) extends Product with Serializable
Evidence that states if the conclusion
C
can be inferred from the premiseP
or not.Evidence that states if the conclusion
C
can be inferred from the premiseP
or not.This type class is used to implement refinement subtyping. If a valid
Inference[P, C]
exists, the typeF[T, P]
is considered a subtype ofF[T, C]
. - trait LowPriorityMaxInstances extends AnyRef
- trait LowPriorityMinInstances extends AnyRef
-
trait
Max[T] extends AnyRef
Type class defining the maximum value of a given type
- trait MaxInstances extends LowPriorityMaxInstances
-
trait
Min[T] extends AnyRef
Type class defining the minimum value of a given type
- trait MinInstances extends LowPriorityMinInstances
- final case class Passed[A](detail: A) extends Result[A] with Product with Serializable
-
trait
RefType[F[_, _]] extends Serializable
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 ofF
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 typeT
.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
)
- the
-
final
class
Refined[T, P] extends AnyVal with Serializable
Wraps a value of type
T
that satisfies the predicateP
. -
trait
RefinedType[FTP] extends Serializable
Type class that combines
RefType
andValidate
instances for a refined typeFTP
. -
class
RefinedTypeOps[FTP, T] extends Serializable
Provides functions to create values of the refined type
FTP
from values of the base typeT
.Provides functions to create values of the refined type
FTP
from values of the base typeT
. 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.from(1) res0: Either[String, PosInt] = Right(1) scala> PosInt.unsafeFrom(2) res1: PosInt = 2
- sealed abstract class Result[A] extends Product with Serializable
-
trait
Validate[T, P] extends Serializable
Type class for validating values of type
T
according to a type-level predicateP
.Type class for validating values of type
T
according to a type-level predicateP
. The semantics ofP
are defined by the instance(s) of this type class forP
.
Value Members
- object Inference extends Serializable
- object Max extends MaxInstances
- object Min extends MinInstances
- object RefType extends Serializable
- object Refined extends Serializable
- object RefinedType extends Serializable
- object RefinedTypeOps extends Serializable
- object Result extends Serializable
- object Validate extends Serializable