Option types require do-notation / computation expressions to be practical in my view. Otherwise you get the pyramid of doom!
match x with
| Some y ->
match y.Foo with
| Some z ->
match z.Bar with
| Some w -> printfn $"{w.Qux}"
| None -> ()
| None -> ()
| None -> ()
Compared to... option {
let! y = x
let! z = y.Foo
let! w = z.Bar
printfn $"{w.Qux}"
}
Funny quirk in Java, the compiler checks that calls to `opt.get()` occur inside an `opt.isPresent()` branch! if (opt.isPresent()) {
println(opt.get());
}