let add x y z = x + y + zlet addResult :Result<intoption,string>= resultOption {let! x = Ok (Some 30)let! y = Ok (Some 10)let! z = Ok (Some 2)return add x y z}// Ok (Some 42)
Example 2
let add x y z = x + y + zlet addResult :Result<intoption,string>= resultOption {let! x = Ok (Some 30)and! y = Error "Oops 1"and! z = Error "Oops 2"return add x y z}// Error "Oops 1"