/** * Continue with the returned computation if the `PartialFunction` matches, * translating the successful match into a failure, otherwise continue with * our held value. * * @tsplus static effect/core/stm/STM.Aspects rejectSTM * @tsplus pipeable effect/core/stm/STM rejectSTM */ export function rejectSTM(pf: (a: A) => Maybe>) { return (self: STM): STM => self.flatMap((a) => pf(a).fold( () => STM.succeed(a), (effect) => effect.flatMap(STM.fail) ) ) }