Returns None if optA is None, otherwise returns optB. The order of arguments is reversed because of that it is useful for partial applying.
None
optA
optB
The second optional when used optA is Some.
Some
optB or a None.
expect(and(none())(none())).toStrictEqual(none());expect(and(none())(some(2))).toStrictEqual(none());expect(and(some("foo"))(none())).toStrictEqual(none());expect(and(some("foo"))(some(2))).toStrictEqual(some("foo")); Copy
expect(and(none())(none())).toStrictEqual(none());expect(and(none())(some(2))).toStrictEqual(none());expect(and(some("foo"))(none())).toStrictEqual(none());expect(and(some("foo"))(some(2))).toStrictEqual(some("foo"));
Returns
NoneifoptAisNone, otherwise returnsoptB. The order of arguments is reversed because of that it is useful for partial applying.