Fold the expected to a common type.
The result of the value function if this was a value or the error function if this was an error.
Function handling the case when error is present.
Function handling the case when value is present.