mapSome<T, U> static method

Maybe<U> mapSome<T, U>(
  1. Maybe<T> maybe,
  2. U converter(
    1. T v
    )
)

Implementation

static Maybe<U> mapSome<T, U>(Maybe<T> maybe, U Function(T v) converter) {
  if (isNothing(maybe)) {
    return Maybe<U>.nothing();
  }
  return Maybe.some(converter(maybe._value!));
}