/** * Fail with `e` if the supplied partial function does not match, otherwise * continue with the returned value. * * @tsplus static effect/core/stm/STM.Aspects continueOrFailSTM * @tsplus pipeable effect/core/stm/STM continueOrFailSTM */ export function continueOrFailSTM(e: E1, pf: (a: A) => Maybe>) { return (self: STM): STM => self.flatMap((a): STM => pf(a).getOrElse(STM.fail(e))) }