Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'));
});
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'));
});
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'));
});
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'));
});
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'));
});
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'));
});
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'));
});
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'));
});