A function used to generate a valid value if maybe
is a
Nothing
.
The Maybe
instance to unwrap if it is a Just
Either the content of maybe
or the value returned from
orElseFn
.
T The wrapped value.
Generated using TypeDoc
Safely get the value out of a
Maybe
by returning the wrapped value if it isJust
, or by applyingorElseFn
if it isNothing
.This is useful when you need to generate a value (e.g. by using current values in the environment – whether preloaded or by local closure) instead of having a single default value available (as in
unwrapOr
).