Evaluate a function on a maybe value
Usage
maybe_map(.m, .f, ...)
fmap(.m, .f, ...)
Arguments
- .m
A maybe value
- .f
A function to apply to the maybe value
- ...
Named arguments for the function .f
Examples
just(9) %>% maybe_map(sqrt)
#> Just
#> [1] 3
nothing() %>% maybe_map(sqrt)
#> Nothing