Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The question mark operator (?) is used to easily propagate some enumerate values. The action of the operator is to:

It works with the following constructs:

Let us redefine our custom error enum for a factorial function:

The factorial function is a bit simpler when dealing the case of the actual computing:

The combination function is drastically simpler, with a one-liner evaluation:

The result is exactly the same as the manual propagation:

Err(ForbiddenNumber)