How to use the sanctuary-type-classes.Alternative function in sanctuary-type-classes

To help you get started, we’ve selected a few sanctuary-type-classes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanctuary-js / sanctuary-either / test / index.js View on Github external
test ('Alternative', () => {
    eq (Z.Alternative.test (Left ([]))) (false);
    eq (Z.Alternative.test (Right ([]))) (false);
  });
github sanctuary-js / sanctuary-maybe / test / index.js View on Github external
test ('Alternative', () => {
    eq (Z.Alternative.test (Nothing)) (true);
    eq (Z.Alternative.test (Just (Useless))) (true);
  });
github sanctuary-js / sanctuary-either / test / index.js View on Github external
test ('Alternative', () => {
    eq (Z.Alternative.test (Left ([]))) (false);
    eq (Z.Alternative.test (Right ([]))) (false);
  });
github sanctuary-js / sanctuary-identity / test / index.js View on Github external
test ('Alternative', () => {
    eq (Z.Alternative.test (Identity ([]))) (false);
  });
github sanctuary-js / sanctuary-maybe / test / index.js View on Github external
test ('Alternative', () => {
    eq (Z.Alternative.test (Nothing)) (true);
    eq (Z.Alternative.test (Just (Useless))) (true);
  });
github fantasyland / fantasy-laws / src / Alternative.js View on Github external
distributivity: assert.forall3 (function(x, f, g) {
      return Z.Alternative.test (x) &&
             Z.Alternative.test (f) &&
             Z.Alternative.test (g) &&
             equals (ap (alt (f) (g)) (x),
                     alt (ap (f) (x)) (ap (g) (x)));
    }),
github fantasyland / fantasy-laws / src / Alternative.js View on Github external
annihilation: assert.forall1 (function(x) {
      return Z.Alternative.test (x) &&
             Z.Alternative.test (zero) &&
             equals (ap (zero) (x),
                     zero);
    })