map<E2> method

Cause<E2> map<E2>(
  1. E2 f(
    1. E
    )
)

Maps the error type of this cause

Implementation

Cause<E2> map<E2>(E2 Function(E) f) {
  return switch (this) {
    Fail(:final error) => Fail(f(error)),
    Die() as Die => this as Cause<E2>,
  };
}