with_default {maybe} | R Documentation |
Unwrap a maybe value or return a default
Description
Unwrap a maybe value or return a default
Usage
with_default(.m, default)
from_maybe(.m, default)
Arguments
.m |
A maybe value |
default |
A default value to return if the maybe value is 'Nothing' |
Value
The unwrapped maybe value or the default value
Examples
just(1) %>% with_default(default = 0)
nothing() %>% with_default(default = 0)
[Package maybe version 1.1.0 Index]