fromOption<L, R> function

TaskEither<L, R> Function(Option<R> option) fromOption<L, R>(
  1. L onNone()
)

Create a TaskEither from an Option. If it is None, then the TaskEither will resolve to a Left containing the result from executing onNone.

Implementation

TaskEither<L, R> Function(Option<R> option) fromOption<L, R>(
  L Function() onNone,
) =>
    either.fromOption<L, R>(onNone).compose(fromEither);