How to use the sanctuary.Either function in sanctuary

To help you get started, we’ve selected a few sanctuary 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 ramda / ramda / test / sequence.js View on Github external
it('traverses left to right', function() {
    eq(R.sequence(S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.sequence(S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.sequence(S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.sequence(S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / traverse.js View on Github external
it('traverses left to right', function() {
    eq(R.traverse(S.Either.of, R.identity, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.traverse(S.Either.of, R.identity, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.traverse(S.Either.of, R.identity, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.traverse(S.Either.of, R.identity, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / commute.js View on Github external
it('traverses left to right', function() {
    eq(R.commute(S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.commute(S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.commute(S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.commute(S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / traverse.js View on Github external
it('traverses left to right', function() {
    eq(R.traverse(S.Either.of, R.identity, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.traverse(S.Either.of, R.identity, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.traverse(S.Either.of, R.identity, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.traverse(S.Either.of, R.identity, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / commute.js View on Github external
it('traverses left to right', function() {
    eq(R.commute(S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.commute(S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.commute(S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.commute(S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / commuteMap.js View on Github external
it('traverses left to right', function() {
    eq(R.commuteMap(R.identity, S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / sequence.js View on Github external
it('traverses left to right', function() {
    eq(R.sequence(S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.sequence(S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.sequence(S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.sequence(S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });
github ramda / ramda / test / commuteMap.js View on Github external
it('traverses left to right', function() {
    eq(R.commuteMap(R.identity, S.Either.of, [S.Right(1), S.Right(2)]), S.Right([1, 2]));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Right(1), S.Left('XXX')]), S.Left('XXX'));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Left('XXX'), S.Right(1)]), S.Left('XXX'));
    eq(R.commuteMap(R.identity, S.Either.of, [S.Left('XXX'), S.Left('YYY')]), S.Left('XXX'));
  });