chainNullableK<A, B> function
A chainable fromNullable variant that transforms the given TaskOption into a nullable value, then flattens the result.
expect(
await some('hello').chain(chainNullableK((s) => '$s world'))(),
O.some('hello world'),
);
expect(
await some('hello').chain(chainNullableK((s) => null))(),
O.none(),
);
Implementation
TaskOption<B> Function(TaskOption<A> value) chainNullableK<A, B>(
B? Function(A a) f,
) =>
flatMap(fromNullableK(f));