match<A> method

IO<A> match<A>(
  1. A onLeft(
    1. L l
    ),
  2. A onRight(
    1. R r
    )
)

Pattern matching to convert a IOEither to a IO.

Execute onLeft when running this IOEither returns a Left. Otherwise execute onRight.

Implementation

IO<A> match<A>(A Function(L l) onLeft, A Function(R r) onRight) =>
    IO(() => run().match(onLeft, onRight));