maybe_contains {maybe}R 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)

[Package maybe version 1.1.0 Index]