match<A, B> function

B Function(Option<A>) match<A, B>({
  1. required B onNone,
  2. required B onSome(
    1. A
    ),
})

Implementation

B Function(Option<A>) match<A, B>({
  required B onNone,
  required B Function(A) onSome,
}) =>
    (option) => switch (option) {
          Some(value: final value) => onSome(value),
          None() => onNone
        };