I have a function (let's call it 'doSomething') that returns:
('a * 'b) option
and would like to achieve something like this:
let testA = doSomething ....
if testA.IsSome then return testA.Value
let testB = doSomething ....
if testB.IsSome then return testB.Value
let testC = doSomething ....
if testC.IsSome then return testC.Value
I'm looking for a computation expression, or an equivalent simple syntax, that would keep executing while the results are None, but leave on the first Some result.
Obviously I want to avoid the while if / elif / elif / ... / elif / else pyramid of doom.