final case class WitnessAs[A, B](fst: A, snd: B) extends Product with Serializable
WitnessAs[A, B] provides the singleton value of type A in fst
and fst converted to type B in snd.
The purpose of this type class is to allow literals of other types than the base type to be used as arguments in numeric predicates.
Example:
scala> import eu.timepit.refined.{refineV, W} | import eu.timepit.refined.api.Refined | import eu.timepit.refined.numeric.{Greater, Less} scala> refineV[Greater[W.`2.718`.T]](BigDecimal(3.141)) res0: Either[String, BigDecimal Refined Greater[W.`2.718`.T]] = Right(3.141) scala> refineV[Less[W.`1`.T]](0.618) res1: Either[String, Double Refined Less[W.`1`.T]] = Right(0.618)
- Source
- WitnessAs.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- WitnessAs
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new WitnessAs(fst: A, snd: B)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val fst: A
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val snd: B
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()