Maps the function onto Option.
Option
The function from T to U.
T
U
The function from Option<T> to Option<U>.
Option<T>
Option<U>
const strLen = map((str: string) => str.length);expect(strLen(some("Hello, World!"))).toStrictEqual(some(13));expect(strLen(none())).toStrictEqual(none()); Copy
const strLen = map((str: string) => str.length);expect(strLen(some("Hello, World!"))).toStrictEqual(some(13));expect(strLen(none())).toStrictEqual(none());
Maps the function onto
Option.