Operators
Namespace: FsToolkit.ErrorHandling.Operator.Result
FsToolkit.ErrorHandling provides the standard infix operators for the map
(<!>
), apply
(<*>
), and bind
(>>=
) functions of the Result
type.
Examples
Example 1
The example that we saw in the Result.map3 can be solved using the map
and apply
operators as below:
Let's assume that we want to implement a function, tryParseEvenInt
, which parses a string to an integer only if the string represents an even integer. We can implement it using the bind
operator as below:
Note that >>=
is just a shortcut for |> Result.bind
:
Last updated