/** * Returns an `STM` effect whose failure and success channels have been mapped by * the specified pair of functions, `f` and `g`. * * @tsplus static effect/core/stm/STM.Aspects mapBoth * @tsplus pipeable effect/core/stm/STM mapBoth */ export function mapBoth(g: (e: E) => E1, f: (a: A) => A1) { return (self: STM): STM => self.foldSTM( (e) => STM.failSync(g(e)), (a) => STM.sync(f(a)) ) }