Skip to contents

Evaluate a ternary maybe returning function on three maybe values

Usage

and_then3(.m1, .m2, .m3, .f, ...)

Arguments

.m1

A maybe value

.m2

A maybe value

.m3

A maybe value

.f

A ternary maybe returning function to apply to the maybe values

...

Named arguments for the function .f

Value

A maybe value

Examples

safe_sum <- maybe(function(x, y, z) sum(x, y, z))

and_then3(just(1), just(2), just(3), safe_sum)
#> Just
#> [1] 6
and_then3(nothing(), just(2), just(3), safe_sum)
#> Nothing