map<T, R> function
Transform the wrapped value if the Option is a Some, using the provided function.
expect(
O.some(1).chain(O.map((i) => i * 2)),
equals(O.some(2)),
);
Implementation
Option<R> Function(Option<T> option) map<T, R>(
R Function(T value) f,
) =>
flatMap((a) => some(f(a)));