Operators
Namespace: FsToolkit.ErrorHandling.Operator.ResultOption
FsToolkit.ErrorHandling provides the standard infix operators for the map
(<!>
), apply
(<*>
), and bind
(>>=
) functions of the Result<Option<_>,_>
type.
In addition to these, it also offers an another infix operator <*^>
for usage with normal Result
values (without an inner Option
). It has the following function signature:
Examples
Example 1
Assume that we have the following function:
Then using the infix operators, we can do the following:
If we have values that are not Option
wrapped, we can use the <*^>
operator:
Example 2
The ResultOption.map2 example can be written using the infix operators as below:
Last updated