fromTask<L, R> function

TaskEither<L, R> fromTask<L, R>(
  1. Task<R> fa
)

Transforms a Task into a TaskEither, wrapping the result in an Right.

expect(
  await fromTask(T.value('hello'))(),
  E.right('hello'),
);

Implementation

TaskEither<L, R> fromTask<L, R>(Task<R> fa) =>
    TaskEither(Task(() => fa().flatMap(either.right)));