Zips two optionals into one with fn.
fn
The zipping operation about T and U.
T
U
The zipped optional of tuple.
interface Point { x: number; y: number;}const newPoint = zipWith((x: number, y: number): Point => ({ x, y,}));expect(newPoint(some(17.5))(some(42.7))).toStrictEqual(some({ x: 17.5, y: 42.7 }));expect(newPoint(none())(none())).toStrictEqual(none()); Copy
interface Point { x: number; y: number;}const newPoint = zipWith((x: number, y: number): Point => ({ x, y,}));expect(newPoint(some(17.5))(some(42.7))).toStrictEqual(some({ x: 17.5, y: 42.7 }));expect(newPoint(none())(none())).toStrictEqual(none());
Zips two optionals into one with
fn.