bind
Function Signature
('okInput -> Result<'okOutput, 'error>) -> Result<'okInput, 'error>
-> Result<'okOutput, 'error>Examples
// string -> Result<int, string>
let tryParseInt (s: string) =
match Int32.TryParse(s) with
| true, i -> Ok i
| false, _ -> Error "Could not parse string as int"Example 1
let result =
Ok "123" // Result<string, string>
|> ResultOption.bind tryParseInt // Result<int, string>
// Ok 123Example 2
Example 3
Last updated