maybe_contains: Check if a maybe value contains a specific value

View source: R/maybe.R

maybe_containsR Documentation

Check if a maybe value contains a specific value

Description

If the maybe value is a 'Nothing' variant FALSE will be returned. If it is a 'Just' variant the contents will be unwrapped and compared to the value argument using base::identical.

Usage

maybe_contains(.m, value)

Arguments

.m

A maybe value

value

A value to check

Value

TRUE or FALSE

Examples

just(1) %>% maybe_contains(1)
just("a") %>% maybe_contains(1)
nothing() %>% maybe_contains(1)

maybe documentation built on Aug. 7, 2023, 5:11 p.m.