Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test ('Alt', () => {
eq (Z.Alt.test (Identity ([]))) (false);
});
test ('Alt', () => {
eq (Z.Alt.test (Left (Useless))) (true);
eq (Z.Alt.test (Right (Useless))) (true);
});
test ('Alt', () => {
eq (Z.Alt.test (Left (Useless))) (true);
eq (Z.Alt.test (Right (Useless))) (true);
});
test ('Alt', () => {
eq (Z.Alt.test (Nothing)) (true);
eq (Z.Alt.test (Just (Useless))) (true);
});
test ('Alt', () => {
eq (Z.Alt.test (Nothing)) (true);
eq (Z.Alt.test (Just (Useless))) (true);
});
function alt$left(left, right){
if(!Z.Alt.test(right)) throwInvalidArgument('alt', 1, 'be an Alt', right);
return Z.alt(left, right);
}
distributivity: assert.forall3 (function(a, b, f) {
return Z.Alt.test (a) &&
Z.Alt.test (b) &&
equals (map (f) (alt (a) (b)),
alt (map (f) (a)) (map (f) (b)));
})
associativity: assert.forall3 (function(a, b, c) {
return Z.Alt.test (a) &&
Z.Alt.test (b) &&
Z.Alt.test (c) &&
equals (alt (alt (a) (b)) (c),
alt (a) (alt (b) (c)));
}),