package refined
- Source
- package.scala
- Alphabetic
- By Inheritance
- refined
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
val
W: Witness.type
Alias for
shapeless.Witness
that provides concise syntax for literal-based singleton types.Alias for
shapeless.Witness
that provides concise syntax for literal-based singleton types.Example:
scala> val d: W.`3.14`.T = 3.14 d: Double(3.14) = 3.14 scala> val s: W.`"abc"`.T = "abc" s: String("abc") = abc
See the shapeless wiki for more information about its support for singleton types.
Note that if a future version of Scala implements SIP-23,
shapeless.Witness
won't be necessary anymore to express literal-based singleton types. It will then be possible to use literals directly in a position where a type is expected. -
def
refineMT[P]: RefineMPartiallyApplied[@@, P]
Alias for
api.RefType.refineM[P]
withshapeless.tag.@@
as type parameter forapi.RefType
.Alias for
api.RefType.refineM[P]
withshapeless.tag.@@
as type parameter forapi.RefType
.Note:
M
stands for macro andT
stands for tag. -
def
refineMV[P]: RefineMPartiallyApplied[Refined, P]
Alias for
api.RefType.refineM[P]
withapi.Refined
as type parameter forapi.RefType
.Alias for
api.RefType.refineM[P]
withapi.Refined
as type parameter forapi.RefType
.Note:
M
stands for macro andV
stands for value class. -
def
refineT[P]: RefinePartiallyApplied[@@, P]
Alias for
api.RefType.refine[P]
withshapeless.tag.@@
as type parameter forapi.RefType
.Alias for
api.RefType.refine[P]
withshapeless.tag.@@
as type parameter forapi.RefType
.Note:
T
stands for tag. -
def
refineV[P]: RefinePartiallyApplied[Refined, P]
Alias for
api.RefType.refine[P]
withapi.Refined
as type parameter forapi.RefType
.Alias for
api.RefType.refine[P]
withapi.Refined
as type parameter forapi.RefType
.Note:
V
stands for value class. -
object
auto
Module that provides automatic refinements and automatic conversions between refined types (refinement subtyping) at compile-time.
-
object
boolean extends BooleanInference0
Module for logical predicates.
-
object
char
Module for
Char
related predicates. -
object
collection extends CollectionInference
Module for collection predicates.
-
object
generic extends GenericInference
Module for generic predicates.
-
object
numeric extends NumericInference
Module for numeric predicates.
Module for numeric predicates.
Int
literals,Double
literals for fractional base types, or literals of the base type can be used as arguments in predicates that have type parameters.Example:
scala> import eu.timepit.refined.api.Refined | import eu.timepit.refined.numeric.{Greater, LessEqual} scala> refineV[Greater[W.`5`.T]](BigInt(10)) res1: Either[String, BigInt Refined Greater[W.`5`.T]] = Right(10) scala> refineV[LessEqual[W.`1.5`.T]](1.4) res2: Either[String, Double Refined LessEqual[W.`1.5`.T]] = Right(1.4)
Note:
generic.Equal
can also be used for numeric types. -
object
string extends StringInference
Module for
String
related predicates.Module for
String
related predicates. Note that most of the predicates incollection
also work forString
s by treating them as sequences ofChar
s.