fromThunk<A> function

Task<A> fromThunk<A>(
  1. Lazy<A> f
)

Create a Task from a thunk / lazy value. A thunk is a function without arguments that returns a value.

expect(await fromThunk(() => 'hello')(), equals('hello'));

Implementation

Task<A> fromThunk<A>(Lazy<A> f) => Task(f);