/** * Extracts the optional value, or fails with the given error 'e'. * * @tsplus static effect/core/stm/STM.Aspects someOrFail * @tsplus pipeable effect/core/stm/STM someOrFail */ export function someOrFail(orFail: LazyArg) { return (self: STM>): STM => self.flatMap((option) => option.fold( STM.sync(orFail).flatMap(STM.fail), STM.succeed ) ) }