fold
Function Signature
('a -> 'b) -> ('c -> 'b)
-> Result<'a, 'c> -> 'bExamples
Example 1
let choice1 = Ok 42 |> Result.fold Choice1Of2 Choice2Of2
// Choice1Of2 42
let choice2 = Error "An error occurred" |> Result.fold Choice1Of2 Choice2Of2
// Choice2Of2 "An error occurred"Example 2
Last updated