map<B> method

Exit<B, E> map<B>(
  1. B f(
    1. A
    )
)

Maps the success value of this exit

Implementation

Exit<B, E> map<B>(B Function(A) f) {
  return switch (this) {
    Success(:final value) => Success(f(value)),
    Failure() => this as Exit<B, E>,
  };
}