eu.timepit.refined.internal
WitnessAs[A, B] provides the singleton value of type A in fst and fst converted to type B in snd.
WitnessAs[A, B]
A
fst
B
snd
The purpose of this type class is to write numeric type class instances that work with both literal singleton types and shapeless.Nat.
shapeless.Nat
Example:
scala> import eu.timepit.refined.W | import shapeless.nat._5 scala> WitnessAs[W.`5`.T, Int] res1: WitnessAs[W.`5`.T, Int] = WitnessAs(5,5) scala> WitnessAs[_5, Int] res2: WitnessAs[_5, Int] = WitnessAs(Succ(),5)
WitnessAs[A, B]
provides the singleton value of typeA
infst
andfst
converted to typeB
insnd
.The purpose of this type class is to write numeric type class instances that work with both literal singleton types and
shapeless.Nat
.Example: