fromOption<C, L, R> function

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

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

Implementation

ReaderTaskEither<C, L, R> Function(Option<R> option) fromOption<C, L, R>(
  L Function() onNone,
) =>
    (o) => ReaderTaskEither((c) => o.chain(TE.fromOption(onNone)));