flatMap<B, E2> method

Exit<B, E2> flatMap<B, E2>(
  1. Exit<B, E2> f(
    1. A
    )
)

Flat maps this exit with a function that returns another exit

Implementation

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