/** * Maps from one error type to another. * * @tsplus static effect/core/stm/STM.Aspects mapError * @tsplus pipeable effect/core/stm/STM mapError */ export function mapError(f: (a: E) => E1) { return (self: STM): STM => self.foldSTM( (e) => STM.failSync(f(e)), STM.succeed ) }