match<W> abstract method

W match<W>({
  1. required W ok(
    1. S
    ),
  2. required W err(
    1. F
    ),
})

Returns the result of ok for the encapsulated value if this instance represents Ok or the result of err function for the encapsulated value if it is Err.

Implementation

W match<W>({required W Function(S) ok, required W Function(F) err});