How to use the sanctuary-type-classes.Contravariant 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-maybe / test / index.js View on Github external
test ('Contravariant', () => {
    eq (Z.Contravariant.test (Nothing)) (false);
    eq (Z.Contravariant.test (Just (Math.sqrt))) (false);
  });
github sanctuary-js / sanctuary-either / test / index.js View on Github external
test ('Contravariant', () => {
    eq (Z.Contravariant.test (Left (Math.sqrt))) (false);
    eq (Z.Contravariant.test (Right (Math.sqrt))) (false);
  });
github sanctuary-js / sanctuary-identity / test / index.js View on Github external
test ('Contravariant', () => {
    eq (Z.Contravariant.test (Identity (Math.sqrt))) (false);
  });
github sanctuary-js / sanctuary-maybe / test / index.js View on Github external
test ('Contravariant', () => {
    eq (Z.Contravariant.test (Nothing)) (false);
    eq (Z.Contravariant.test (Just (Math.sqrt))) (false);
  });
github sanctuary-js / sanctuary-either / test / index.js View on Github external
test ('Contravariant', () => {
    eq (Z.Contravariant.test (Left (Math.sqrt))) (false);
    eq (Z.Contravariant.test (Right (Math.sqrt))) (false);
  });
github fantasyland / fantasy-laws / src / Contravariant.js View on Github external
identity: assert.forall1 (function(u) {
      return Z.Contravariant.test (u) &&
             equals (contramap (identity) (u),
                     u);
    }),
github fantasyland / fantasy-laws / src / Contravariant.js View on Github external
composition: assert.forall3 (function(u, f, g) {
      return Z.Contravariant.test (u) &&
             equals (contramap (compose (f) (g)) (u),
                     compose (contramap (g)) (contramap (f)) (u));
    })