flatMap<A, B> function
Transform the Option into another Option, using the given function.
expect(
some(1).chain(flatMap((i) => some(i + 2))),
some(3),
);
expect(
some(1).chain(flatMap((i) => none())),
none(),
);
Implementation
Option<B> Function(Option<A> option) flatMap<A, B>(
Option<B> Function(A value) f,
) =>
(o) => o._bindSome(f);