I am looking for an fp-ts function that has this behavior:
function compute1(arg: number): Option<number>;
function compute2(arg: number): Option<number>;
function compute3(arg: number): Option<number>;
function compute(arg: number): Option<number> {
const first = compute1(arg)
if (isSome(first)) return first
const second = compute2(arg)
if (isSome(second)) return second
const third = compute3(arg)
if (isSome(third)) return third
return none
}
// For example I am looking for this `or` function:
const compute = or([
compute1,
compute2,
compute3,
])
I was not able to find a corresponding function in the documentation of Option here.