when<R> method

R when<R>({
  1. required R some(
    1. T
    ),
  2. required R none(),
})
inherited

Invokes either some or none depending on the option.

Identical to match except that the arguments are named.

Implementation

R when<R>({required R Function(T) some, required R Function() none}) {
  return match(some, none);
}