How to use the monet.Either function in monet

To help you get started, we’ve selected a few monet 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 char0n / ramda-adjunct / test / cata.js View on Github external
specify('should support Either type', function() {
      const eitherR = monet.Either.Right(1);
      const eitherL = monet.Either.Left(2);

      assert.strictEqual(RA.cata(null, R.identity, eitherR), 1);
      assert.strictEqual(RA.cata(R.identity, null, eitherL), 2);
    });
github char0n / ramda-adjunct / test / cata.js View on Github external
specify('should return value from Right', function() {
      const eitherR = monet.Either.Right(1);

      assert.throws(RA.cata.bind(null, R.identity, null, eitherR), TypeError);
      assert.strictEqual(RA.cata(null, R.identity, eitherR), 1);
    });
  });