/** * Folds over the `STM` effect, handling both P.failure and success, but not * retry. * * @tsplus static effect/core/stm/STM.Aspects fold * @tsplus pipeable effect/core/stm/STM fold */ export function fold(g: (e: E) => C, f: (a: A) => B) { return (self: STM): STM => self.foldSTM( (e) => STM.sync(g(e)), (a) => STM.sync(f(a)) ) }