is.ok: Check if Result is Ok

Description Usage Arguments Value Examples

View source: R/check.R

Description

Test whether Result Enum is Ok or an Err.

Usage

1
is.ok(x)

Arguments

x

object to be tested

Value

TRUE if x is enumerated type of variant Ok, FALSE otherwise

Examples

1
2
3
4
5
6
sqrt_big <- function(x) {
  if (x > 1000){ return(Ok(sqrt(x))) }
  Err("Not large enough!")
}
x <- sqrt_big(250)
is.ok(x)  # FALSE

matchr documentation built on Sept. 9, 2021, 5:07 p.m.

Related to is.ok in matchr...