Additional operations on Result<'T,'Error>
Function or value | Description |
|
![]() ![]() ![]() ![]() ![]() ![]()
Applies the wrapped value to the wrapped function when both are Ok and returns a wrapped result or the first Error.
The function wrapped in an Ok or an Error.
The value wrapped in an Ok or an Error.
|
Full Usage:
Result.bindError binder source
Parameters:
'Error -> Result<'T, 'Error2>
-
A function that takes the error and transforms it into a result.
source : Result<'T, 'Error>
-
The source input value.
Returns: Result<'T, 'Error2>
A result of the output type of the binder.
Modifiers: inline Type parameters: 'Error, 'T, 'Error2 |
![]() ![]() ![]() ![]() ![]() ![]() If the input value is an Ok leaves it unchanged, otherwise maps the Error value and flattens the resulting nested Result.
|
Full Usage:
Result.defaultValue value source
Parameters:
'T
source : Result<'T, 'Error>
Returns: 'T
|
|
Full Usage:
Result.defaultWith compensation source
Parameters:
'Error -> 'T
source : Result<'T, 'Error>
Returns: 'T
|
|
Full Usage:
Result.either fOk fError source
Parameters:
'T -> 'U
-
Function to be applied to source, if it contains an Ok value.
fError : 'Error -> 'U
-
Function to be applied to source, if it contains an Error value.
source : Result<'T, 'Error>
-
The source value, containing an Ok or an Error.
Returns: 'U
The result of applying either functions.
Modifiers: inline Type parameters: 'T, 'U, 'Error |
|
|
|
|
|
|
|
Full Usage:
Result.map3 f x y z
Parameters:
'T -> 'U -> 'V -> 'W
-
The mapping function.
x : Result<'T, 'Error>
-
The first Result value.
y : Result<'U, 'Error>
-
The second Result value.
z : Result<'V, 'Error>
-
The third Result value.
Returns: Result<'W, 'Error>
The combined value, or the first Error.
|
|
|
|
Full Usage:
Result.partition source
Parameters:
Result<'T, 'Error> list
Returns: 'T list * 'Error list
A tuple with both resulting lists, Oks are in the first list.
|
![]() ![]() ![]() ![]() ![]() ![]() Creates two lists by classifying the values depending on whether they were wrapped with Ok or Error.
|
|
![]() ![]() ![]() ![]() ![]() ![]() Creates a safe version of the supplied function, which returns a Result<'U,exn> instead of throwing exceptions.
|
|
|
|
|
|
|