Additional operations on Option
Function or value | Description |
Full Usage:
Option.apply f x
Parameters:
('T -> 'U) option
-
The option function.
x : 'T option
-
The option value.
Returns: 'U option
An option of the function applied to the value, or None if either the function or the value is None .
|
|
Full Usage:
Option.ofPair (arg1, arg2)
Parameters:
bool
arg1 : 'T
Returns: 'T option
Some if bool is `true`, None otherwise.
|
|
Full Usage:
Option.ofResult source
Parameters:
Result<'T, 'Error>
-
The Result value.
Returns: 'T option
The resulting option value.
|
The error value (if any) is lost.
|
Full Usage:
Option.protect f x
Parameters:
'T -> 'U
x : 'T
Returns: 'U option
|
|
Full Usage:
Option.toResult source
Parameters:
'T option
-
The option value.
Returns: Result<'T, unit>
The resulting Result value.
|
|
Full Usage:
Option.toResultWith errorValue source
Parameters:
'Error
-
The error value to be used in case of None.
source : 'T option
-
The option value.
Returns: Result<'T, 'Error>
The resulting Result value.
|
|
Full Usage:
Option.unzip v
Parameters:
('T * 'U) option
-
The value.
Returns: 'T option * 'U option
The resulting tuple.
|
|
Full Usage:
Option.zip x y
Parameters:
'T option
-
The first value.
y : 'U option
-
The second value.
Returns: ('T * 'U) option
The resulting option.
|
|
Full Usage:
Option.zip3 x y z
Parameters:
'T option
-
The first value.
y : 'U option
-
The second value.
z : 'V option
-
The third value.
Returns: ('T * 'U * 'V) option
The resulting option.
|