Returns Some if exactly one of optA and optB is Some, otherwise returns None. The order of arguments is reversed because of that it is useful for partial applying.
Some
optA
optB
None
The second optional.
optA exclusive or optB.
expect(xor(none())(none())).toStrictEqual(none());expect(xor(none())(some(2))).toStrictEqual(some(2));expect(xor(some(100))(none())).toStrictEqual(some(100));expect(xor(some(100))(some(2))).toStrictEqual(none()); Copy
expect(xor(none())(none())).toStrictEqual(none());expect(xor(none())(some(2))).toStrictEqual(some(2));expect(xor(some(100))(none())).toStrictEqual(some(100));expect(xor(some(100))(some(2))).toStrictEqual(none());
Returns
Someif exactly one ofoptAandoptBisSome, otherwise returnsNone. The order of arguments is reversed because of that it is useful for partial applying.