mapJust<K> method

Maybe<K> mapJust<K>(
  1. Maybe<K> combiner(
    1. T
    )
)

A method to chain access to data held by the Maybe. If this is Nothing returns Nothing, if this is Just, returns the result of the combiner method over the value inside Just

Implementation

Maybe<K> mapJust<K>(Maybe<K> Function(T) combiner) {
  return when(
    nothing: () => Nothing<K>(),
    just: (T data) => combiner(data),
  );
}