opt_unwrap: Option Unwrap

View source: R/optional.R

opt_unwrapR Documentation

Option Unwrap

Description

Cast an optional object to its base type.

Usage

opt_unwrap(opt)

Arguments

opt

The optional variable to cast back

Details

Since an optional can be used the same way as its base type, there is no known scenario where this function might be useful.

Value

The object wrapped in opt. NULL if opt is none.

See Also

make_opt(), match_with()

Examples

a <- option(5)
class(a)
## [1] "optional"
a <- opt_unwrap(a)

class(a)
## [1] "numeric"

optional documentation built on April 28, 2022, 1:07 a.m.