with_default {maybe} | R Documentation |
Unwrap a maybe value or return a default
with_default(.m, default)
from_maybe(.m, default)
.m |
A maybe value |
default |
A default value to return if the maybe value is 'Nothing' |
The unwrapped maybe value or the default value
just(1) %>% with_default(default = 0)
nothing() %>% with_default(default = 0)