match<B> abstract method

B match<B>(
  1. B onNone(
      ),
    1. B onSome(
      1. T t
      )
    )

    Execute onSome when value is Some, otherwise execute onNone.

    [🍌].match(() => 🍎, (🍌) => 🍌 * 2) -> 🍌🍌
    [_].match(() => 🍎, (🍌) => 🍌 * 2) -> 🍎
    

    Same as fold.

    Implementation

    B match<B>(B Function() onNone, B Function(T t) onSome);