ReaderTaskEither<E, L, R>.fromTaskOption constructor
ReaderTaskEither<E, L, R>.fromTaskOption (
- TaskOption<
R> task, - L onNone()
Build a ReaderTaskEither that returns a Right containing the result of running task
,
or the result of onNone
if task
is Left.
Implementation
factory ReaderTaskEither.fromTaskOption(
TaskOption<R> task,
L Function() onNone,
) =>
ReaderTaskEither(
(_) async => Either.fromOption(await task.run(), onNone),
);