Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test ('Setoid', () => {
eq (Z.Setoid.test (Identity (Useless))) (false);
eq (Z.Setoid.test (Identity (/(?:)/))) (true);
});
test ('Setoid', () => {
eq (Z.Setoid.test (Nothing)) (true);
eq (Z.Setoid.test (Just (Useless))) (false);
eq (Z.Setoid.test (Just (/(?:)/))) (true);
});
test ('Setoid', () => {
eq (Z.Setoid.test (Nothing)) (true);
eq (Z.Setoid.test (Just (Useless))) (false);
eq (Z.Setoid.test (Just (/(?:)/))) (true);
});
it ('should resolve multiple contraints', () => {
const tcs = [Z.Monoid, Z.Setoid];
const {constraints} = resolve ($) (tcs) ($.env) ('foo :: (Monoid a, Setoid b) => a -> b');
assert.deepEqual (constraints, {a: [Z.Monoid], b: [Z.Setoid]});
});
test ('Setoid', () => {
eq (Z.Setoid.test (Identity (Useless))) (false);
eq (Z.Setoid.test (Identity (/(?:)/))) (true);
});
test ('Setoid', () => {
eq (Z.Setoid.test (Left (Useless))) (false);
eq (Z.Setoid.test (Left (/(?:)/))) (true);
eq (Z.Setoid.test (Right (Useless))) (false);
eq (Z.Setoid.test (Right (/(?:)/))) (true);
});
test ('Setoid', () => {
eq (Z.Setoid.test (Left (Useless))) (false);
eq (Z.Setoid.test (Left (/(?:)/))) (true);
eq (Z.Setoid.test (Right (Useless))) (false);
eq (Z.Setoid.test (Right (/(?:)/))) (true);
});
symmetry: assert.forall2 (function(a, b) {
return Z.Setoid.test (a) &&
Z.Setoid.test (b) &&
Z.equals (a, b) === Z.equals (b, a);
}),
reflexivity: assert.forall1 (function(a) {
return Z.Setoid.test (a) &&
Z.equals (a, a);
}),