is.err {matchr} | R Documentation |
Test whether Result Enum is Ok or an Err.
is.err(x)
x |
object to be tested |
TRUE
if x
is enumerated type of variant Err
, FALSE
otherwise
sqrt_big <- function(x) {
if (x > 1000){ return(Ok(sqrt(x))) }
Err("Not large enough!")
}
x <- sqrt_big(250)
is.err(x) # TRUE