ReaderTaskEither<E, L, R>.fromIOOption constructor

ReaderTaskEither<E, L, R>.fromIOOption(
  1. IOOption<R> io,
  2. L onNone()
)

Build a ReaderTaskEither that returns a Right containing the result of running io, or the result of onNone if io is Left.

Implementation

factory ReaderTaskEither.fromIOOption(
  IOOption<R> io,
  L Function() onNone,
) =>
    ReaderTaskEither(
      (_) async => Either.fromOption(io.run(), onNone),
    );