alt method

  1. @override
IOOption<R> alt(
  1. covariant IOOption<R> orElse()
)
override

When this IOOption returns Some, then return the current IOOption. Otherwise return the result of orElse.

Used to provide an alternative IOOption in case the current one returns None.

Implementation

@override
IOOption<R> alt(covariant IOOption<R> Function() orElse) =>
    IOOption(() => run().match(
          () => orElse().run(),
          some,
        ));