is.none: Check if Option is None

Description Usage Arguments Value Examples

View source: R/check.R

Description

Test whether Option Enum is Some or None.

Usage

1

Arguments

x

object to be tested

Value

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

Examples

1
2
3
4
5
6
7
x <- 1:5
get_n <- function(x, n) {
  if (n > length(x)) return(None)
  Some(x[n])
}
obj <- get_n(x, 6)
is.none(obj)  # TRUE

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

Related to is.none in matchr...