effect 3.6.5 → 3.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -461,13 +461,13 @@ export const concat = /*#__PURE__*/dual(2, (self, that) => new StreamImpl(pipe(t
461
461
  /** @internal */
462
462
  export const concatAll = streams => suspend(() => pipe(streams, Chunk.reduce(empty, (x, y) => concat(y)(x))));
463
463
  /** @internal */
464
- export const cross = /*#__PURE__*/dual(2, (self, that) => pipe(self, crossWith(that, (a, a2) => [a, a2])));
464
+ export const cross = /*#__PURE__*/dual(2, (left, right) => pipe(left, crossWith(right, (a, a2) => [a, a2])));
465
465
  /** @internal */
466
- export const crossLeft = /*#__PURE__*/dual(2, (self, that) => pipe(self, crossWith(that, (a, _) => a)));
466
+ export const crossLeft = /*#__PURE__*/dual(2, (left, right) => pipe(left, crossWith(right, (a, _) => a)));
467
467
  /** @internal */
468
- export const crossRight = /*#__PURE__*/dual(2, (self, that) => flatMap(self, () => that));
468
+ export const crossRight = /*#__PURE__*/dual(2, (left, right) => flatMap(left, () => right));
469
469
  /** @internal */
470
- export const crossWith = /*#__PURE__*/dual(3, (self, that, f) => pipe(self, flatMap(a => pipe(that, map(b => f(a, b))))));
470
+ export const crossWith = /*#__PURE__*/dual(3, (left, right, f) => pipe(left, flatMap(a => pipe(right, map(b => f(a, b))))));
471
471
  /** @internal */
472
472
  export const debounce = /*#__PURE__*/dual(2, (self, duration) => pipe(singleProducerAsyncInput.make(), Effect.flatMap(input => Effect.transplant(grafter => pipe(Handoff.make(), Effect.map(handoff => {
473
473
  const enqueue = last => pipe(Clock.sleep(duration), Effect.as(last), Effect.fork, grafter, Effect.map(fiber => consumer(DebounceState.previous(fiber))));
@@ -2533,7 +2533,7 @@ export const zipAllWith = /*#__PURE__*/dual(2, (self, options) => {
2533
2533
  return combineChunks(self, options.other, ZipAllState.PullBoth, pull);
2534
2534
  });
2535
2535
  /** @internal */
2536
- export const zipLatest = /*#__PURE__*/dual(2, (self, that) => pipe(self, zipLatestWith(that, (a, a2) => [a, a2])));
2536
+ export const zipLatest = /*#__PURE__*/dual(2, (left, right) => pipe(left, zipLatestWith(right, (a, a2) => [a, a2])));
2537
2537
  export const zipLatestAll = (...streams) => {
2538
2538
  if (streams.length === 0) {
2539
2539
  return empty;
@@ -2544,9 +2544,9 @@ export const zipLatestAll = (...streams) => {
2544
2544
  return zipLatestWith(head, zipLatestAll(...tail), (first, second) => [first, ...second]);
2545
2545
  };
2546
2546
  /** @internal */
2547
- export const zipLatestWith = /*#__PURE__*/dual(3, (self, that, f) => {
2547
+ export const zipLatestWith = /*#__PURE__*/dual(3, (left, right, f) => {
2548
2548
  const pullNonEmpty = pull => pipe(pull, Effect.flatMap(chunk => Chunk.isEmpty(chunk) ? pullNonEmpty(pull) : Effect.succeed(chunk)));
2549
- return pipe(toPull(self), Effect.map(pullNonEmpty), Effect.zip(pipe(toPull(that), Effect.map(pullNonEmpty))), Effect.flatMap(([left, right]) => pipe(fromEffectOption(Effect.raceWith(left, right, {
2549
+ return pipe(toPull(left), Effect.map(pullNonEmpty), Effect.zip(pipe(toPull(right), Effect.map(pullNonEmpty))), Effect.flatMap(([left, right]) => pipe(fromEffectOption(Effect.raceWith(left, right, {
2550
2550
  onSelfDone: (leftDone, rightFiber) => pipe(Effect.suspend(() => leftDone), Effect.zipWith(Fiber.join(rightFiber), (l, r) => [l, r, true])),
2551
2551
  onOtherDone: (rightDone, leftFiber) => pipe(Effect.suspend(() => rightDone), Effect.zipWith(Fiber.join(leftFiber), (l, r) => [r, l, false]))
2552
2552
  })), flatMap(([l, r, leftFirst]) => pipe(fromEffect(Ref.make([Chunk.unsafeLast(l), Chunk.unsafeLast(r)])), flatMap(latest => pipe(fromChunk(leftFirst ? pipe(r, Chunk.map(a2 => f(Chunk.unsafeLast(l), a2))) : pipe(l, Chunk.map(a => f(a, Chunk.unsafeLast(r))))), concat(pipe(repeatEffectOption(left), mergeEither(repeatEffectOption(right)), mapEffectSequential(Either.match({
@@ -2555,21 +2555,21 @@ export const zipLatestWith = /*#__PURE__*/dual(3, (self, that, f) => {
2555
2555
  })), flatMap(fromChunk))))))), toPull)), fromPull);
2556
2556
  });
2557
2557
  /** @internal */
2558
- export const zipLeft = /*#__PURE__*/dual(2, (self, that) => pipe(self, zipWithChunks(that, (left, right) => {
2558
+ export const zipLeft = /*#__PURE__*/dual(2, (left, right) => pipe(left, zipWithChunks(right, (left, right) => {
2559
2559
  if (left.length > right.length) {
2560
2560
  return [pipe(left, Chunk.take(right.length)), Either.left(pipe(left, Chunk.take(right.length)))];
2561
2561
  }
2562
2562
  return [left, Either.right(pipe(right, Chunk.drop(left.length)))];
2563
2563
  })));
2564
2564
  /** @internal */
2565
- export const zipRight = /*#__PURE__*/dual(2, (self, that) => pipe(self, zipWithChunks(that, (left, right) => {
2565
+ export const zipRight = /*#__PURE__*/dual(2, (left, right) => pipe(left, zipWithChunks(right, (left, right) => {
2566
2566
  if (left.length > right.length) {
2567
2567
  return [right, Either.left(pipe(left, Chunk.take(right.length)))];
2568
2568
  }
2569
2569
  return [pipe(right, Chunk.take(left.length)), Either.right(pipe(right, Chunk.drop(left.length)))];
2570
2570
  })));
2571
2571
  /** @internal */
2572
- export const zipWith = /*#__PURE__*/dual(3, (self, that, f) => pipe(self, zipWithChunks(that, (leftChunk, rightChunk) => zipChunks(leftChunk, rightChunk, f))));
2572
+ export const zipWith = /*#__PURE__*/dual(3, (left, right, f) => pipe(left, zipWithChunks(right, (leftChunk, rightChunk) => zipChunks(leftChunk, rightChunk, f))));
2573
2573
  /** @internal */
2574
2574
  export const zipWithChunks = /*#__PURE__*/dual(3, (self, that, f) => {
2575
2575
  const pull = (state, pullLeft, pullRight) => {