Returns a RefType
for the given type F
from the implicit scope.
Returns a value of type T
refined as FTP
on the right if it
satisfies the predicate in FTP
, or an error message on the left
otherwise.
Returns a value of type T
refined as FTP
on the right if it
satisfies the predicate in FTP
, or an error message on the left
otherwise.
Example:
scala> import eu.timepit.refined.api._ | import eu.timepit.refined.numeric._ scala> RefType.applyRef[Int Refined Positive](10) res1: Either[String, Refined[Int, Positive]] = Right(Refined(10))
Note: The return type is internal.ApplyRefPartiallyApplied[FTP]
,
which has an apply
method on it, allowing applyRef
to be called
like in the given example.