either Functions
// int -> int
let okF (x : int) = x + 1
// int -> int
let errorF (x : int) = x - 1Result.either
Function Signature
('okInput -> 'output) -> ('errorInput -> 'output)
-> Result<'okInput, 'errorInput> -> 'outputExamples
Example 1
let result =
Ok 1
|> Result.either okF errorF
// 2Result.eitherMap
Function Signature
Examples
Example 1
Last updated