fromNullable<L, R> function

TaskEither<L, R> fromNullable<L, R>(
  1. R? value,
  2. L onNone()
)

Create a TaskEither from a nullable value. onNone is executed if the given value is null.

Implementation

TaskEither<L, R> fromNullable<L, R>(
  R? value,
  L Function() onNone,
) =>
    option.fromNullable(value).chain(fromOption(onNone));