eitherMap
AsyncResult.eitherMap
Function Signature:
('okInput -> 'okOutput)
-> ('errorInput -> 'errorOutput)
-> Async<Result<'okInput, 'errorInput>>
-> Async<Result<'okOutput, 'errorOutput>>Examples
Example 1
let result : Async<Result<string, int>> =
AsyncResult.ok 42
|> AsyncResult.eitherMap
(fun n -> sprintf "Got %d" n)
(fun err -> -1)
// evaluates to Ok "Got 42"Example 2
Example 3
Last updated