Effect CommunityEC
Effect Community3y ago
6 replies
ts

Understanding `zipRight` and `zipLeft` Equivalence

Hey, I seem to be misunderstanding zipRight and zipLeft. Why are these two equivalent?
const a = E.Effect.sync(() => {
    console.log('a');
});
const b = E.Effect.sync(() => {
    console.log('b');
});

// b
// a
console.log(E.Effect.runSync(E.Effect.zipLeft(a)(b)));
// b
// a
console.log(E.Effect.runSync(E.Effect.zipRight(a)(b)));


I would assume the order to be flipped.
Was this page helpful?