import * as tsplus_module_1 from "@effect/core/stm/STM/operations/succeedNow";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/map";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_4 from "@effect/core/stm/STM/operations/flatMap";
/**
 * Extracts the optional value, or executes the effect 'orElse'.
 *
 * @tsplus fluent ets/STM someOrElseSTM
 */

export function someOrElseSTM_(self, orElse) {
  return tsplus_module_4.flatMap_(self, option => tsplus_module_3.getOrElse_(tsplus_module_2.map_(option, tsplus_module_1.succeedNow), orElse));
}
/**
 * Extracts the optional value, or executes the effect 'orElse'.
 *
 * @tsplus static ets/STM/Aspects someOrElseSTM
 */

export const someOrElseSTM = orElse => self => someOrElseSTM_(self, orElse);
//# sourceMappingURL=someOrElseSTM.mjs.map