| 1 | effect/Sink#Sink: |
| 2 | replacement: "Sink" |
| 3 | note: "Interface kept as Sink<A, In, L, E, R> with the same type parameters; the internal representation changed from a Channel wrapper to a `transform: (upstream: Pull<NonEmptyReadonlyArray<In>>, scope) => Effect<End<A, L>>` function, and completion is the tuple `Sink.End<A, L> = readonly [value, leftover?]`." |
| 4 | effect/Sink#Sink.Variance: |
| 5 | replacement: "Sink.Variance" |
| 6 | note: "Still exists as the namespace interface Sink.Variance<A, In, L, E, R> (with Sink.VarianceStruct); the variance key is now the internal string \"~effect/Sink\" instead of the SinkTypeId symbol." |
| 7 | effect/Sink#SinkTypeId: |
| 8 | replacement: "none" |
| 9 | note: "The type id is the unexported internal string \"~effect/Sink\" (no unique symbol, no export); use the new guard Sink.isSink(u) instead of checking the symbol." |
| 10 | effect/Sink#SinkUnify: |
| 11 | replacement: "SinkUnify" |
| 12 | note: "Kept with the same name and shape (extends Effect.EffectUnify, preserves all five Sink type parameters)." |
| 13 | effect/Sink#SinkUnifyIgnore: |
| 14 | replacement: "SinkUnifyIgnore" |
| 15 | note: "Kept with the same name; now a standalone `{ Effect?: true }` interface instead of extending Effect.EffectUnifyIgnore." |
| 16 | effect/Sink#collectAll: |
| 17 | replacement: "Sink.collect" |
| 18 | note: "Renamed; returns Sink<Array<In>, In> collecting into a plain mutable Array instead of Chunk." |
| 19 | effect/Sink#collectAllFrom: |
| 20 | replacement: "none" |
| 21 | note: "Repeated-run result accumulation was removed; checked the v4 export list (no collectAllFrom/repeatedly). Re-implement with Sink.fromTransform, looping self.transform on the upstream pull (feeding leftovers back) until the upstream ends, accumulating results in an array." |
| 22 | effect/Sink#collectAllN: |
| 23 | replacement: "Sink.take" |
| 24 | note: "Sink.take(n) returns Sink<Array<In>, In, In> collecting up to n elements (Array instead of Chunk), emitting the unconsumed remainder as leftovers." |
| 25 | effect/Sink#collectAllToMap: |
| 26 | replacement: "Sink.reduce" |
| 27 | note: "Built-in HashMap collector removed; build a plain Map in the reducer: Sink.reduce(() => new Map<K, In>(), (m, in_) => { const k = key(in_); return m.set(k, m.has(k) ? merge(m.get(k)!, in_) : in_) })." |
| 28 | effect/Sink#collectAllToMapN: |
| 29 | replacement: "none" |
| 30 | note: "Removed; approximating with Sink.reduceWhile((...) , (m) => m.size < n, ...) consumes (merges) the element that introduces the (n+1)-th key, whereas v3 left it as leftover — exact v3 leftover behavior needs a custom Sink.fromTransform that checks the key before consuming." |
| 31 | effect/Sink#collectAllToSet: |
| 32 | replacement: "Sink.reduce" |
| 33 | note: "Built-in HashSet collector removed; build a plain Set: Sink.reduce(() => new Set<In>(), (s, in_) => s.add(in_))." |
| 34 | effect/Sink#collectAllToSetN: |
| 35 | replacement: "Sink.reduceWhile" |
| 36 | note: "Removed; equivalent via Sink.reduceWhile(() => new Set<In>(), (s) => s.size < n, (s, in_) => s.add(in_)) — stops with leftovers once n distinct values are collected (plain Set instead of HashSet)." |
| 37 | effect/Sink#collectAllUntil: |
| 38 | replacement: "Sink.takeUntil" |
| 39 | note: "Renamed; Sink.takeUntil(predicate) collects into Array<In> until the predicate matches, including the matching element, like v3." |
| 40 | effect/Sink#collectAllUntilEffect: |
| 41 | replacement: "Sink.takeUntilEffect" |
| 42 | note: "Renamed; Sink.takeUntilEffect(p) collects into Array<In> until the effectful predicate returns true, including the matching element." |
| 43 | effect/Sink#collectAllWhile: |
| 44 | replacement: "Sink.takeWhile" |
| 45 | note: "Renamed; Sink.takeWhile(predicate) collects the matching prefix into Array<In>, keeps the refinement overload, and excludes the first failing element (returned via leftovers)." |
| 46 | effect/Sink#collectAllWhileEffect: |
| 47 | replacement: "Sink.takeWhileEffect" |
| 48 | note: "Renamed; Sink.takeWhileEffect(p) collects into Array<In> while the effectful predicate returns true." |
| 49 | effect/Sink#collectAllWhileWith: |
| 50 | replacement: "none" |
| 51 | note: "Repeatedly-run-and-fold was removed (no v4 counterpart in the export list); re-implement with Sink.fromTransform looping self.transform while the `while` predicate holds on each result, folding results with `body` and feeding leftovers back into the next run." |
| 52 | effect/Sink#collectLeftover: |
| 53 | replacement: "Sink.mapEnd" |
| 54 | note: "Use Sink.mapEnd to move the leftovers into the result: Sink.mapEnd(self, ([a, leftover]) => [[a, leftover ?? []] as const]); leftovers are NonEmptyReadonlyArray<L> | undefined instead of Chunk<L>." |
| 55 | effect/Sink#context: |
| 56 | replacement: "Sink.fromEffect(Effect.context())" |
| 57 | note: "Sink.context was removed; Sink.fromEffect(Effect.context<R>()) yields the same Sink<Context<R>, unknown, never, never, R>." |
| 58 | effect/Sink#contextWith: |
| 59 | replacement: "Sink.fromEffect(Effect.contextWith(f))" |
| 60 | note: "Removed; compose Sink.fromEffect with Effect.contextWith to derive a value from the context." |
| 61 | effect/Sink#contextWithEffect: |
| 62 | replacement: "Sink.fromEffect(Effect.flatMap(Effect.context(), f))" |
| 63 | note: "Removed, and v4 Effect has no contextWithEffect; use Sink.fromEffect(Effect.flatMap(Effect.context<R0>(), f))." |
| 64 | effect/Sink#contextWithSink: |
| 65 | replacement: "Sink.unwrap(Effect.contextWith(f))" |
| 66 | note: "Removed; Sink.unwrap(Effect.contextWith((ctx: Context.Context<R0>) => f(ctx))) builds the sink from the context." |
| 67 | effect/Sink#dieMessage: |
| 68 | replacement: "Sink.die" |
| 69 | note: "Removed (v4 has no RuntimeException-based dieMessage anywhere); use Sink.die(new Error(message))." |
| 70 | effect/Sink#dieSync: |
| 71 | replacement: "Sink.failCauseSync" |
| 72 | note: "Removed; use Sink.failCauseSync(() => Cause.die(evaluate())) to defer defect evaluation, or Sink.die(defect) when eager is fine." |
| 73 | effect/Sink#dimap: |
| 74 | replacement: "Sink.mapInput + Sink.map" |
| 75 | note: "Removed; compose the two halves: self.pipe(Sink.mapInput(f), Sink.map(g))." |
| 76 | effect/Sink#dimapEffect: |
| 77 | replacement: "Sink.mapInputEffect + Sink.mapEffect" |
| 78 | note: "Removed; compose self.pipe(Sink.mapInputEffect(f), Sink.mapEffect(g))." |
| 79 | effect/Sink#dimapChunks: |
| 80 | replacement: "Sink.mapInputArray + Sink.map" |
| 81 | note: "Removed; compose self.pipe(Sink.mapInputArray(f), Sink.map(g)) — f now maps NonEmptyReadonlyArray instead of Chunk and must return a non-empty array." |
| 82 | effect/Sink#dimapChunksEffect: |
| 83 | replacement: "Sink.mapInputArrayEffect + Sink.mapEffect" |
| 84 | note: "Removed; compose self.pipe(Sink.mapInputArrayEffect(f), Sink.mapEffect(g)) — f maps NonEmptyReadonlyArray instead of Chunk and must return a non-empty array." |
| 85 | effect/Sink#drop: |
| 86 | replacement: "none" |
| 87 | note: "The drop* sinks were removed (nothing in the v4 export list); drop on the stream side instead with Stream.drop(n) before running the sink, or write a Sink.fromTransform that discards the first n pulled elements." |
| 88 | effect/Sink#dropUntil: |
| 89 | replacement: "none" |
| 90 | note: "Removed with the other drop* sinks; use Stream.dropUntil(predicate) on the stream before running the sink." |
| 91 | effect/Sink#dropUntilEffect: |
| 92 | replacement: "none" |
| 93 | note: "Removed; use Stream.dropUntilEffect(p) on the stream before running the sink." |
| 94 | effect/Sink#dropWhile: |
| 95 | replacement: "none" |
| 96 | note: "Removed; use Stream.dropWhile(predicate) on the stream before running the sink." |
| 97 | effect/Sink#dropWhileEffect: |
| 98 | replacement: "none" |
| 99 | note: "Removed; use Stream.dropWhileEffect(p) on the stream before running the sink." |
| 100 | effect/Sink#ensuringWith: |
| 101 | replacement: "Sink.onExit" |
| 102 | note: "Renamed; Sink.onExit(self, (exit: Exit<A, E>) => finalizer) runs after completion, failure, or interruption — the exit now carries the sink's result value A (v3 passed Exit<unknown, E>). Plain Sink.ensuring(effect) also still exists for the exit-independent case." |
| 103 | effect/Sink#filterInput: |
| 104 | replacement: "none" |
| 105 | note: "Removed, and not expressible via Sink.mapInputArray because its function must return a non-empty array (a fully-filtered batch is illegal); filter on the stream with Stream.filter(predicate) before running the sink, or write a Sink.fromTransform that skips empty filtered batches." |
| 106 | effect/Sink#filterInputEffect: |
| 107 | replacement: "none" |
| 108 | note: "Removed (same non-empty-array constraint as filterInput); use Stream.filterEffect(p) on the stream before running the sink." |
| 109 | effect/Sink#foldChunks: |
| 110 | replacement: "Sink.reduceWhileArray" |
| 111 | note: "Sink.reduceWhileArray(() => s, contFn, f) folds whole input batches; initial state is now a lazy thunk and f receives NonEmptyReadonlyArray<In> instead of Chunk<In>." |
| 112 | effect/Sink#foldChunksEffect: |
| 113 | replacement: "Sink.reduceWhileArrayEffect" |
| 114 | note: "Sink.reduceWhileArrayEffect(() => s, contFn, f) is the effectful array-level fold with continuation predicate; lazy initial state, NonEmptyReadonlyArray instead of Chunk. Sink.foldArray has the same shape but does not check contFn on the initial state." |
| 115 | effect/Sink#foldEffect: |
| 116 | replacement: "Sink.reduceWhileEffect" |
| 117 | note: "Sink.reduceWhileEffect(() => s, contFn, f) folds element-by-element with an effectful step and continuation predicate (checked on the initial state, like v3); initial state is now a lazy thunk. v4 Sink.fold has the same signature but skips the initial-state check." |
| 118 | effect/Sink#foldLeft: |
| 119 | replacement: "Sink.reduce" |
| 120 | note: "Renamed; Sink.reduce(() => s, f) — initial state is now a lazy thunk, semantics otherwise identical." |
| 121 | effect/Sink#foldLeftChunks: |
| 122 | replacement: "Sink.reduceArray" |
| 123 | note: "Renamed; Sink.reduceArray(() => s, f) folds whole batches — lazy initial state, f receives NonEmptyReadonlyArray<In> instead of Chunk<In>." |
| 124 | effect/Sink#foldLeftChunksEffect: |
| 125 | replacement: "Sink.reduceWhileArrayEffect" |
| 126 | note: "No plain reduceArrayEffect exists in v4; use Sink.reduceWhileArrayEffect(() => s, () => true, f) (constant-true predicate) — f receives NonEmptyReadonlyArray<In> instead of Chunk<In> and the result has L = never like v3." |
| 127 | effect/Sink#foldLeftEffect: |
| 128 | replacement: "Sink.reduceEffect" |
| 129 | note: "Renamed; Sink.reduceEffect(() => s, f) — lazy initial state, effectful step, no termination predicate." |
| 130 | effect/Sink#foldSink: |
| 131 | replacement: "Sink.orElse + Sink.flatMap" |
| 132 | note: "The two-channel match was removed; compose self.pipe(Sink.orElse((e) => options.onFailure(e)), Sink.flatMap((a) => options.onSuccess(a))) — orElse switches to the failure sink (resuming the same upstream), flatMap feeds leftovers to the success sink first." |
| 133 | effect/Sink#foldUntilEffect: |
| 134 | replacement: "Sink.foldUntil" |
| 135 | note: "v4 Sink.foldUntil(() => s, max, f) takes the effectful step function directly (f returns Effect<S, E, R>), so it covers v3 foldUntilEffect; initial state is now a lazy thunk. For the pure v3 foldUntil wrap the step in Effect.succeed." |
| 136 | effect/Sink#foldWeighted: |
| 137 | replacement: "none" |
| 138 | note: "The whole foldWeighted family was removed from v4 Sink (checked the export list); re-implement with Sink.fold carrying the accumulated cost in the state (cont while cost < max), returning leftovers automatically when stopping mid-batch." |
| 139 | effect/Sink#foldWeightedDecompose: |
| 140 | replacement: "none" |
| 141 | note: "Removed with no decompose mechanism in v4; splitting oversized elements must happen upstream (transform the stream before the sink) or inside a custom Sink.fromTransform." |
| 142 | effect/Sink#foldWeightedDecomposeEffect: |
| 143 | replacement: "none" |
| 144 | note: "Removed; same as foldWeightedDecompose — no effectful weighted/decompose fold exists, re-implement via Sink.fromTransform or restructure upstream." |
| 145 | effect/Sink#foldWeightedEffect: |
| 146 | replacement: "none" |
| 147 | note: "Removed; re-implement with Sink.fold (its step is effectful in v4) tracking accumulated cost in the state." |
| 148 | effect/Sink#forEachChunk: |
| 149 | replacement: "Sink.forEachArray" |
| 150 | note: "Renamed; f receives NonEmptyReadonlyArray<In> instead of Chunk<In>." |
| 151 | effect/Sink#forEachChunkWhile: |
| 152 | replacement: "Sink.forEachWhileArray" |
| 153 | note: "Renamed; f: (NonEmptyReadonlyArray<In>) => Effect<boolean> continues while true, stops on false, as in v3." |
| 154 | effect/Sink#fromPush: |
| 155 | replacement: "Sink.fromTransform" |
| 156 | note: "The push-based protocol (Option<Chunk> push function failing with [Either, leftovers]) is gone; v4's low-level constructor is pull-based: Sink.fromTransform((upstream: Pull<NonEmptyReadonlyArray<In>>, scope) => Effect<End<A, L>>) — pull inputs from upstream and finish by succeeding with the [value, leftover?] tuple." |
| 157 | effect/Sink#leftover: |
| 158 | replacement: "Sink.succeed" |
| 159 | note: "Removed as a standalone constructor; Sink.succeed now takes optional leftovers: Sink.succeed(void 0, leftovers) where leftovers is a NonEmptyReadonlyArray<L> instead of Chunk<L>." |
| 160 | effect/Sink#mapInputChunks: |
| 161 | replacement: "Sink.mapInputArray" |
| 162 | note: "Renamed; f maps NonEmptyReadonlyArray<In0> => NonEmptyReadonlyArray<In> (must stay non-empty) instead of Chunk => Chunk." |
| 163 | effect/Sink#mapInputChunksEffect: |
| 164 | replacement: "Sink.mapInputArrayEffect" |
| 165 | note: "Renamed; f maps NonEmptyReadonlyArray<In0> => Effect<NonEmptyReadonlyArray<In>> (must stay non-empty) instead of Chunk => Effect<Chunk>." |
| 166 | effect/Sink#mkString: |
| 167 | replacement: "Sink.reduceArray" |
| 168 | note: "Removed as a built-in; equivalent one-liner: Sink.reduceArray(() => \"\", (s, arr) => s + arr.join(\"\"))." |
| 169 | effect/Sink#race: |
| 170 | replacement: "none" |
| 171 | note: "Sink racing (race/raceBoth/raceWith) was removed from v4; broadcast the stream (Stream.broadcast) into two consumers and race the resulting run effects with Effect.race, or write a custom Channel." |
| 172 | effect/Sink#raceBoth: |
| 173 | replacement: "none" |
| 174 | note: "Removed with the race family; broadcast the stream and use Effect.raceBoth (or Effect.race) on the two Stream.run effects to learn which side won." |
| 175 | effect/Sink#raceWith: |
| 176 | replacement: "none" |
| 177 | note: "Removed, along with the MergeDecision type it depended on; the closest is broadcasting the stream and combining the two run effects manually (Effect.raceWith on the run effects)." |
| 178 | effect/Sink#refineOrDie: |
| 179 | replacement: "Sink.catch" |
| 180 | note: "Removed; rebuild with the typed-error handler: Sink.catch(self, (e) => Option.match(pf(e), { onSome: Effect.fail, onNone: () => Effect.die(e) })) — note Sink.catch replaces the result on recovery, so refined errors must be re-failed as shown." |
| 181 | effect/Sink#refineOrDieWith: |
| 182 | replacement: "Sink.catch" |
| 183 | note: "Removed; same pattern as refineOrDie but die with the mapped defect: Sink.catch(self, (e) => Option.match(pf(e), { onSome: Effect.fail, onNone: () => Effect.die(f(e)) }))." |
| 184 | effect/Sink#splitWhere: |
| 185 | replacement: "none" |
| 186 | note: "Removed; it re-chunked input so the sink stopped before the first later element matching the predicate — closest v4 options are pre-splitting the stream (Stream.split / Stream.takeWhile) or a custom Sink.fromTransform that cuts pulled arrays at the predicate boundary and returns the rest as leftovers." |
| 187 | effect/Sink#unwrapScoped: |
| 188 | replacement: "Sink.unwrap" |
| 189 | note: "Folded into Sink.unwrap, whose signature now excludes Scope from R (Sink<..., Exclude<R, Scope> | R2>), so scoped effects are accepted directly; resources stay open for the sink's lifetime." |
| 190 | effect/Sink#unwrapScopedWith: |
| 191 | replacement: "Sink.unwrap" |
| 192 | note: "Folded into Sink.unwrap — obtain the scope inside the effect via Effect.scope (Sink.unwrap(Effect.flatMap(Effect.scope, f))); for direct scope access use Sink.fromTransform, whose transform receives (upstream, scope)." |
| 193 | effect/Sink#zip: |
| 194 | replacement: "Sink.flatMap" |
| 195 | note: "The zip family was removed; sequential zip is self.pipe(Sink.flatMap((a) => Sink.map(that, (a2) => [a, a2] as const))) — leftovers of the first sink feed the second. The { concurrent: true } racing mode has no v4 equivalent." |
| 196 | effect/Sink#zipLeft: |
| 197 | replacement: "Sink.flatMap" |
| 198 | note: "Removed; use self.pipe(Sink.flatMap((a) => Sink.as(that, a))) to run both sequentially and keep the first result (no concurrent option)." |
| 199 | effect/Sink#zipRight: |
| 200 | replacement: "Sink.flatMap" |
| 201 | note: "Removed; use self.pipe(Sink.flatMap(() => that)) to run both sequentially and keep the second result (no concurrent option)." |
| 202 | effect/Sink#zipWith: |
| 203 | replacement: "Sink.flatMap" |
| 204 | note: "Removed; use self.pipe(Sink.flatMap((a) => Sink.map(that, (a2) => f(a, a2)))) — sequential only, the { concurrent: true } option has no v4 equivalent." |