/** * Returns an effect that will produce the value of this effect, unless it * fails with the `None` value, in which case it will produce the value of the * specified effect. * * @tsplus static effect/core/stm/STM.Aspects orElseOptional * @tsplus pipeable effect/core/stm/STM orElseOptional */ export function orElseOptional(that: LazyArg, A1>>) { return (self: STM, A>): STM, A | A1> => self.catchAll((option) => option.fold(that, (e) => STM.fail(Maybe.some(e)))) }