is.none {matchr}R Documentation

Check if Option is None

Description

Test whether Option Enum is Some or None.

Usage

is.none(x)

Arguments

x

object to be tested

Value

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

Examples

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

[Package matchr version 0.1.0 Index]