match<A> method

IO<A> match<A>(
  1. A onNone(),
  2. A onSome(
    1. R r
    )
)

Pattern matching to convert a IOOption to a IO.

Execute onNone when running this IOOption returns a None. Otherwise execute onSome.

Implementation

IO<A> match<A>(A Function() onNone, A Function(R r) onSome) =>
    IO(() => run().match(
          onNone,
          onSome,
        ));