fromNullable<A> function
Create a TaskOption from a value that could be null
. If it is not null
,
then it will resolve to Some. null
values become None.
expect(
await fromNullable('hello')(),
O.some('hello'),
);
expect(
await fromNullable(null)(),
O.none(),
);
Implementation
TaskOption<A> fromNullable<A>(A? a) => TaskOption(T.value(O.fromNullable(a)));