| 1 | effect/Stream#bind: |
| 2 | include: true |
| 3 | replacement: "Stream.bind" |
| 4 | note: "The input must be a record. Start from Stream.Do or use Stream.bindTo(name) to wrap a non-record element. The field name may now re-bind an existing key; the resulting record type is Simplify<Omit<A, N> & Record<N, B>>." |
| 5 | effect/Stream#bindEffect: |
| 6 | include: true |
| 7 | replacement: "Stream.bindEffect" |
| 8 | note: "The input must be a record. Start from Stream.Do or use Stream.bindTo(name) to wrap a non-record element. Existing keys may be re-bound, with the new value replacing the old field type. The callback still returns an Effect." |
| 9 | effect/Stream#catchTags: |
| 10 | include: true |
| 11 | replacement: "Stream.catchTags" |
| 12 | note: "Only keys present in the tagged error union are accepted; remove handlers for tags the stream cannot fail with. Untagged errors remain in the error channel." |
| 13 | effect/Stream#mapBoth: |
| 14 | include: true |
| 15 | replacement: "Stream.mapBoth" |
| 16 | note: "Rename the options onSuccess to onElement and onFailure to onError. The callbacks still transform emitted elements and typed errors respectively." |
| 17 | effect/Stream#partition: |
| 18 | include: true |
| 19 | replacement: "Stream.partition" |
| 20 | note: "Pass a Result-returning Filter instead of a boolean predicate or refinement; Filter.fromPredicate(predicate) adapts existing predicates. The tuple order is now [passes, fails], the reverse of v3 [excluded, satisfying]. Rename bufferSize to capacity (default 16; also accepts \"unbounded\"). Acquisition is scoped and does not fail with E; the returned streams carry E." |
| 21 | effect/Stream#scan: |
| 22 | include: true |
| 23 | replacement: "Stream.scan" |
| 24 | note: "Wrap the initial state in a thunk: Stream.scan(() => initial, step). The thunk is evaluated for each stream run; allocate mutable initial state inside it to avoid sharing state between runs." |
| 25 | effect/Stream#scanEffect: |
| 26 | include: true |
| 27 | replacement: "Stream.scanEffect" |
| 28 | note: "Wrap the initial state in a thunk: Stream.scanEffect(() => initial, step). It is evaluated for each stream run; the step still returns an Effect." |
| 29 | effect/Stream#runIntoPubSub: |
| 30 | include: true |
| 31 | replacement: "Stream.runIntoPubSub" |
| 32 | note: "Pass a PubSub of plain elements rather than Take wrappers. Both overloads return Effect<void, E, R>, so handle stream failures on the returned Effect instead of expecting them as PubSub messages. The optional shutdownOnEnd flag controls PubSub shutdown." |
| 33 | effect/Stream#let: |
| 34 | include: true |
| 35 | replacement: "Stream.let" |
| 36 | note: "Retained in v4 and aligned with Effect.let: the field name may re-bind an existing key (the computed value replaces it) and the record type is Simplify<Omit<A, N> & Record<N, B>>." |
| 37 | effect/Stream#Stream: |
| 38 | replacement: "Stream" |
| 39 | note: "The Stream<A, E, R> interface is unchanged in shape and keeps the effect/Stream import path; the type-id key is now the string literal \"~effect/Stream\" instead of a unique symbol." |
| 40 | effect/Stream#Stream.Context: |
| 41 | replacement: "Stream.Services" |
| 42 | note: "Type-level extractor of the R parameter renamed from Stream.Context<T> to Stream.Services<T>; identical conditional-infer semantics." |
| 43 | effect/Stream#Stream.DynamicTuple: |
| 44 | replacement: "Types.TupleOf" |
| 45 | note: "Already deprecated in v3 in favor of Types.TupleOf; removed in v4. Use Types.TupleOf<N, T> (v4 Stream.broadcastN uses it for its return type)." |
| 46 | effect/Stream#Stream.DynamicTupleOf: |
| 47 | replacement: "Types.TupleOf" |
| 48 | note: "Recursive tuple-builder helper removed with Stream.DynamicTuple; Types.TupleOf<N, T> is the v4 equivalent." |
| 49 | effect/Stream#StreamTypeId: |
| 50 | replacement: "Stream.TypeId" |
| 51 | note: "Renamed StreamTypeId -> TypeId and changed from a unique symbol to the string literal \"~effect/Stream\" (both the const and the type)." |
| 52 | effect/Stream#StreamUnify: |
| 53 | replacement: "Stream.StreamUnify" |
| 54 | note: "Still exported under the same name in v4 (extends Effect.EffectUnify); no change needed besides any Chunk-related element types." |
| 55 | effect/Stream#StreamUnifyIgnore: |
| 56 | replacement: "Stream.StreamUnifyIgnore" |
| 57 | note: "Still exported under the same name in v4 (extends Effect.EffectUnifyIgnore with Effect ignored); unchanged." |
| 58 | effect/Stream#accumulateChunks: |
| 59 | replacement: "none" |
| 60 | note: "v3 accumulateChunks only rewrote the internal chunk layout (each chunk cumulatively contained all prior elements) without changing the emitted element sequence; v4 has no chunk-layout twin. Stream.accumulate emits the cumulative NonEmptyArray values, and Stream.rechunk controls chunk sizing." |
| 61 | effect/Stream#acquireRelease: |
| 62 | replacement: "Stream.scoped(Stream.fromEffect(Effect.acquireRelease(acquire, release)))" |
| 63 | note: "Dedicated constructor removed; compose Effect.acquireRelease (same (resource, exit) release signature) with Stream.fromEffect, then Stream.scoped to tie the finalizer to the stream's lifetime." |
| 64 | effect/Stream#aggregateWithinEither: |
| 65 | replacement: "Stream.aggregateWithin" |
| 66 | note: "Either-emitting variant removed; v4 aggregateWithin(sink, schedule) emits only the sink outputs B (schedule outputs are no longer surfaced as Either.right)." |
| 67 | effect/Stream#as: |
| 68 | include: true |
| 69 | replacement: "Stream.as" |
| 70 | note: "Retained in v4 with the same signature; replaces every element with the provided constant value." |
| 71 | effect/Stream#async: |
| 72 | replacement: "Stream.callback" |
| 73 | note: "Stream.callback((queue) => Effect | void, { bufferSize?, strategy? }) replaces the Emit-based async; push with Queue.offer/offerAll, end with Queue.end, fail with Queue.fail." |
| 74 | effect/Stream#asyncEffect: |
| 75 | replacement: "Stream.callback" |
| 76 | note: "The register function of Stream.callback may return an Effect (run before the stream starts pulling), covering asyncEffect; signal end/failure through the provided Queue." |
| 77 | effect/Stream#asyncPush: |
| 78 | replacement: "Stream.callback" |
| 79 | note: "Stream.callback's register effect can use Scope for acquire/release of the external subscription, replacing asyncPush; the Emit ops helpers become plain Queue operations." |
| 80 | effect/Stream#asyncScoped: |
| 81 | replacement: "Stream.callback" |
| 82 | note: "Stream.callback's register effect may use Scope (Scope is excluded from the resulting R), replacing asyncScoped; the Option<E> end signal becomes Queue.end." |
| 83 | effect/Stream#branchAfter: |
| 84 | replacement: "Stream.peel" |
| 85 | note: "Removed; the closest v4 primitive is Stream.peel(self, Sink.take(n)), a scoped Effect yielding [firstN, restStream] from which you build the continuation stream and re-wrap with Stream.unwrap." |
| 86 | example: "Stream.unwrap(Effect.map(Stream.peel(self, Sink.take(n)), ([head, rest]) => f(head)(rest)))" |
| 87 | effect/Stream#broadcastDynamic: |
| 88 | replacement: "Stream.broadcast" |
| 89 | note: "v4 Stream.broadcast({ capacity, strategy?, replay? }) is the dynamic-subscriber fan-out returning Effect<Stream<A, E>, never, Scope | R> (v3 fixed-arity broadcast(n) became Stream.broadcastN); Stream.share adds refcounted/idleTimeToLive semantics." |
| 90 | effect/Stream#broadcastedQueues: |
| 91 | replacement: "none" |
| 92 | note: "Queue-of-Take fan-out surface removed. Use Stream.broadcastN({ n, capacity }) for a fixed tuple of mirror streams, or Stream.toPubSubTake to obtain a PubSub of Take values and subscribe consumers to it." |
| 93 | effect/Stream#broadcastedQueuesDynamic: |
| 94 | replacement: "none" |
| 95 | note: "Removed with broadcastedQueues. Use Stream.broadcast (dynamic mirror streams) or Stream.toPubSubTake + PubSub subscriptions when raw Take-level consumers are needed." |
| 96 | effect/Stream#bufferChunks: |
| 97 | replacement: "Stream.bufferArray" |
| 98 | note: "Chunk->Array rename; buffers whole arrays (chunks) up to capacity with the same strategy options." |
| 99 | effect/Stream#catchAll: |
| 100 | replacement: "Stream.catch" |
| 101 | note: "Renamed to Stream.catch (exported keyword-style); same (error) => Stream handler for all typed failures." |
| 102 | effect/Stream#catchAllCause: |
| 103 | replacement: "Stream.catchCause" |
| 104 | note: "Renamed; handler receives the full Cause<E> and returns a recovery stream, identical semantics." |
| 105 | effect/Stream#catchSome: |
| 106 | replacement: "Stream.catchFilter" |
| 107 | note: "Option-returning partial handler replaced by the Filter API: Stream.catchFilter(filter, f, orElse?) recovers matched errors, unmatched failures pass through (Stream.catchIf for refinement/predicate matching)." |
| 108 | effect/Stream#catchSomeCause: |
| 109 | replacement: "Stream.catchCauseFilter" |
| 110 | note: "Option-returning cause handler replaced by Stream.catchCauseFilter(filter, f, orElse?) using a Filter on the Cause (Stream.catchCauseIf for refinements)." |
| 111 | effect/Stream#chunksWith: |
| 112 | replacement: "Stream.flattenArray(f(Stream.chunks(self)))" |
| 113 | note: "No dedicated combinator; expose chunk structure with Stream.chunks (Stream<NonEmptyReadonlyArray<A>>), transform, then re-flatten with Stream.flattenArray." |
| 114 | effect/Stream#combineChunks: |
| 115 | replacement: "Stream.combineArray" |
| 116 | note: "Chunk->Array rename of the pull-level combining primitive; pulls now yield NonEmptyReadonlyArray values and halt via Cause.Done-failing Pull effects instead of Option-typed errors." |
| 117 | effect/Stream#concatAll: |
| 118 | replacement: "Stream.flatten" |
| 119 | note: "Chunk-of-streams constructor removed; sequential concatenation of many streams is Stream.flatten(Stream.fromIterable(streams)) (default concurrency 1 preserves order)." |
| 120 | effect/Stream#context: |
| 121 | replacement: "Stream.fromEffect(Effect.context<R>())" |
| 122 | note: "Dedicated accessor removed; lift Effect.context<R>() into a single-element stream." |
| 123 | effect/Stream#contextWith: |
| 124 | replacement: "Stream.fromEffect(Effect.contextWith(f))" |
| 125 | note: "Dedicated accessor removed; Effect.contextWith still exists in v4, lift it with Stream.fromEffect." |
| 126 | effect/Stream#contextWithEffect: |
| 127 | replacement: "Stream.fromEffect(Effect.flatMap(Effect.context<R0>(), f))" |
| 128 | note: "Removed; read the Context with Effect.context, feed it to the effectful function, and lift the result with Stream.fromEffect." |
| 129 | effect/Stream#contextWithStream: |
| 130 | replacement: "Stream.unwrap(Effect.contextWith(f))" |
| 131 | note: "Removed; build the dependent stream inside Effect.contextWith and flatten with Stream.unwrap." |
| 132 | effect/Stream#crossLeft: |
| 133 | replacement: "Stream.crossWith(that, (a, _) => a)" |
| 134 | note: "Removed; cartesian product keeping only left elements is expressed with Stream.crossWith and a left-projecting combiner." |
| 135 | effect/Stream#crossRight: |
| 136 | replacement: "Stream.crossWith(that, (_, b) => b)" |
| 137 | note: "Removed; cartesian product keeping only right elements is Stream.crossWith with a right-projecting combiner (equivalently Stream.flatMap(self, () => that))." |
| 138 | effect/Stream#dieMessage: |
| 139 | replacement: "Stream.die(new Error(message))" |
| 140 | note: "Removed along with RuntimeException; die with an explicit defect value via Stream.die." |
| 141 | effect/Stream#dieSync: |
| 142 | replacement: "Stream.failCauseSync(() => Cause.die(evaluate()))" |
| 143 | note: "Removed; lazily construct the defect cause with Cause.die inside Stream.failCauseSync." |
| 144 | effect/Stream#distributedWith: |
| 145 | replacement: "none" |
| 146 | note: "Predicate-routed fixed fan-out to Take queues removed (no v4 counterpart found among broadcast/broadcastN/share/toPubSub/partition). Closest patterns: Stream.broadcastN + Stream.filter per branch, Stream.partition for two-way splits, or manual routing by running the stream into per-consumer Queues." |
| 147 | effect/Stream#distributedWithDynamic: |
| 148 | replacement: "none" |
| 149 | note: "Dynamic predicate-routed fan-out removed with distributedWith. Use Stream.broadcast/Stream.share for dynamic mirrors plus per-subscriber Stream.filter, or hand-roll routing into Queues via Stream.runForEach." |
| 150 | effect/Stream#either: |
| 151 | replacement: "Stream.result" |
| 152 | note: "Either is replaced by Result in v4: Stream.result yields Stream<Result.Result<A, E>, never, R> (element -> Result.succeed, first error -> Result.fail and the stream ends, as before)." |
| 153 | effect/Stream#ensuringWith: |
| 154 | replacement: "Stream.onExit" |
| 155 | note: "Renamed; Stream.onExit runs the finalizer with the Exit<unknown, E> of the stream, identical shape." |
| 156 | effect/Stream#execute: |
| 157 | replacement: "Stream.fromEffectDrain" |
| 158 | note: "Renamed; runs the effect for its side effects and emits nothing (Stream<never, E, R>)." |
| 159 | effect/Stream#filterMapWhile: |
| 160 | replacement: "Stream.takeWhileFilter" |
| 161 | note: "Option-returning partial function replaced by the Filter API: Stream.takeWhileFilter(filter) maps and emits while the filter passes, ending the stream at the first miss." |
| 162 | effect/Stream#filterMapWhileEffect: |
| 163 | replacement: "none" |
| 164 | note: "No effectful takeWhileFilter variant in v4. Recreate by using Stream.takeWhileFilter with a Filter that selects the Effect<A2, E2, R2> to run, followed by Stream.mapEffect((eff) => eff) to execute it." |
| 165 | effect/Stream#finalizer: |
| 166 | replacement: "Stream.ensuring" |
| 167 | note: "One-element finalizer-registering stream removed; attach finalizers directly with Stream.ensuring/Stream.onExit, or register in the stream scope via Stream.scoped(Stream.fromEffect(Effect.addFinalizer(fin))) when the v3 concat-a-finalizer pattern must be preserved." |
| 168 | effect/Stream#find: |
| 169 | replacement: "Stream.take(Stream.filter(self, predicate), 1)" |
| 170 | note: "Removed; first-match semantics are Stream.filter followed by Stream.take(1)." |
| 171 | effect/Stream#findEffect: |
| 172 | replacement: "Stream.take(Stream.filterEffect(self, f), 1)" |
| 173 | note: "Removed; Stream.filterEffect takes an effectful (a, index) => Effect<boolean> predicate, then Stream.take(1) stops at the first match." |
| 174 | effect/Stream#flattenChunks: |
| 175 | replacement: "Stream.flattenArray" |
| 176 | note: "Chunk->Array rename; flattens a Stream of ReadonlyArray values into their elements." |
| 177 | effect/Stream#flattenExitOption: |
| 178 | replacement: "Stream.flattenTake" |
| 179 | note: "The Exit<A, Option<E>> end-of-stream encoding is gone; v4 uses Take<A, E, Done> = NonEmptyReadonlyArray<A> | Exit and Stream.flattenTake unwraps it (emit arrays, end/fail on Exit)." |
| 180 | effect/Stream#flattenIterables: |
| 181 | replacement: "Stream.flattenIterable" |
| 182 | note: "Renamed (singular); flattens a Stream of Iterables into their elements." |
| 183 | effect/Stream#fromChunk: |
| 184 | replacement: "Stream.fromArray" |
| 185 | note: "Chunk->Array rename; takes a ReadonlyArray and emits it as one chunk." |
| 186 | effect/Stream#fromChunkPubSub: |
| 187 | replacement: "Stream.fromPubSub" |
| 188 | note: "Chunked PubSub constructors are gone; v4 Stream.fromPubSub(pubsub) consumes PubSub<A> directly (batched internally). For a PubSub carrying arrays use Stream.flattenArray(Stream.fromPubSub(pubsub)); the scoped/shutdown options were dropped (Stream.fromSubscription consumes an existing subscription)." |
| 189 | effect/Stream#fromChunkQueue: |
| 190 | replacement: "Stream.fromQueue" |
| 191 | note: "Chunked Queue constructor gone; v4 Stream.fromQueue consumes Queue.Dequeue<A, E> whose done/failure signals end the stream (no shutdown option). For array payloads wrap with Stream.flattenArray." |
| 192 | effect/Stream#fromChunks: |
| 193 | replacement: "Stream.fromArrays" |
| 194 | note: "Chunk->Array rename; variadic arrays, each emitted as one chunk." |
| 195 | effect/Stream#fromEffectOption: |
| 196 | replacement: "none" |
| 197 | note: "The Effect<A, Option<E>> encoding (fail None = empty stream) is removed; v4 signals early end with Cause.Done in Pull-level code. Rebuild with Stream.unwrap: map the success to Stream.succeed and match the Option error to Stream.empty (None) or Stream.fail (Some)." |
| 198 | effect/Stream#fromReadableStreamByob: |
| 199 | replacement: "Stream.fromReadableStream" |
| 200 | note: "BYOB reader variant removed (no byob support in v4 source); Stream.fromReadableStream({ evaluate, onError, releaseLockOnEnd? }) consumes any ReadableStream with a default reader, without byte-buffer allocation control." |
| 201 | effect/Stream#fromTPubSub: |
| 202 | replacement: "none" |
| 203 | note: "STM TPubSub was replaced by the transactional TxPubSub module and v4 Stream has no Tx* constructors; subscribe and repeatedly TxQueue.take from the subscription (e.g. inside Stream.fromPull/Stream.callback), or bridge through a regular PubSub and Stream.fromPubSub." |
| 204 | effect/Stream#fromTQueue: |
| 205 | replacement: "none" |
| 206 | note: "STM TQueue was replaced by TxQueue and v4 Stream has no Tx* constructors; drain by repeatedly calling TxQueue.take inside a custom loop (Stream.fromPull/Stream.callback), or bridge into a regular Queue and use Stream.fromQueue." |
| 207 | effect/Stream#haltAfter: |
| 208 | replacement: "Stream.haltWhen(Effect.sleep(duration))" |
| 209 | note: "Duration-specialized halt removed; v3 documented it as haltWhen with a sleep — completes the stream after the duration without interrupting an in-flight pull." |
| 210 | effect/Stream#haltWhenDeferred: |
| 211 | replacement: "Stream.haltWhen(Deferred.await(deferred))" |
| 212 | note: "Deferred-specialized variant removed; Deferred.await is an Effect, so plain Stream.haltWhen covers it." |
| 213 | effect/Stream#identity: |
| 214 | replacement: "Channel.identity" |
| 215 | note: "The identity-pipeline Stream is gone; for pipeThrough-style plumbing use Stream.pipeThroughChannel(Channel.identity()), or simply the identity function where a Stream=>Stream transform is expected." |
| 216 | effect/Stream#interruptAfter: |
| 217 | replacement: "Stream.interruptWhen(Effect.sleep(duration))" |
| 218 | note: "Duration-specialized interrupt removed; interruptWhen forks the sleep and also interrupts an in-progress pull, matching v3 semantics." |
| 219 | effect/Stream#interruptWhenDeferred: |
| 220 | replacement: "Stream.interruptWhen(Deferred.await(deferred))" |
| 221 | note: "Deferred-specialized variant removed; pass Deferred.await to Stream.interruptWhen (a Deferred failure surfaces as the stream's failure, as before)." |
| 222 | effect/Stream#mapChunks: |
| 223 | replacement: "Stream.mapArray" |
| 224 | note: "Chunk->Array rename; transforms each emitted chunk as a NonEmptyReadonlyArray." |
| 225 | effect/Stream#mapChunksEffect: |
| 226 | replacement: "Stream.mapArrayEffect" |
| 227 | note: "Chunk->Array rename of the effectful per-chunk transform." |
| 228 | effect/Stream#mapConcat: |
| 229 | replacement: "Stream.flattenIterable(Stream.map(self, f))" |
| 230 | note: "Removed; map each element to an Iterable and flatten with Stream.flattenIterable." |
| 231 | effect/Stream#mapConcatChunk: |
| 232 | replacement: "Stream.flattenArray(Stream.map(self, f))" |
| 233 | note: "Chunk variant removed with Chunk itself; map to a ReadonlyArray and flatten with Stream.flattenArray." |
| 234 | effect/Stream#mapConcatChunkEffect: |
| 235 | replacement: "Stream.flattenArray(Stream.mapEffect(self, f))" |
| 236 | note: "Removed; effectfully map each element to a ReadonlyArray and flatten with Stream.flattenArray." |
| 237 | effect/Stream#mapConcatEffect: |
| 238 | replacement: "Stream.flattenIterable(Stream.mapEffect(self, f))" |
| 239 | note: "Removed; effectfully map each element to an Iterable and flatten with Stream.flattenIterable." |
| 240 | effect/Stream#mapErrorCause: |
| 241 | replacement: "Stream.catchCause((cause) => Stream.failCause(f(cause)))" |
| 242 | note: "Removed; transform the full Cause by catching it and re-failing with the mapped cause." |
| 243 | effect/Stream#mapInputContext: |
| 244 | replacement: "Stream.updateContext" |
| 245 | note: "Renamed; same contravariant (Context<R2>) => Context<R> mapping of the required services." |
| 246 | effect/Stream#mergeEither: |
| 247 | replacement: "Stream.mergeResult" |
| 248 | note: "Either replaced by Result: Stream.mergeResult(self, that) yields Result.Result<A, A2> with self -> Result.succeed and that -> Result.fail (v3 put self in Either.left and that in Either.right, so the success/left roles swap sides)." |
| 249 | effect/Stream#mergeWith: |
| 250 | replacement: "Stream.merge(Stream.map(self, onSelf), Stream.map(that, onOther), { haltStrategy })" |
| 251 | note: "Removed; pre-map both streams to the common type and use Stream.merge, whose options accept the same haltStrategy union (\"left\" | \"right\" | \"both\" | \"either\")." |
| 252 | effect/Stream#mergeWithTag: |
| 253 | replacement: "none" |
| 254 | note: "Struct-to-tagged-union merge removed. Recreate with Stream.mergeAll over the entries, tagging each stream first." |
| 255 | example: "Stream.mergeAll(Object.entries(streams).map(([_tag, s]) => Stream.map(s, (value) => ({ _tag, value }))), { concurrency })" |
| 256 | effect/Stream#onDone: |
| 257 | replacement: "Stream.onEnd" |
| 258 | note: "Renamed; v4 onEnd takes an Effect value (not a () => Effect thunk) run when the stream ends successfully, and its error type may add to the stream's." |
| 259 | |
| 260 | effect/Stream#orDieWith: |
| 261 | replacement: "Stream.orDie" |
| 262 | note: "orDieWith removed; transform the error first, then convert failures to defects: `self.pipe(Stream.mapError(f), Stream.orDie)`." |
| 263 | effect/Stream#orElse: |
| 264 | replacement: "Stream.catch" |
| 265 | note: "v3 catchAll was renamed to Stream.catch in v4; orElse ignored the error, so write `Stream.catch(self, () => that())`." |
| 266 | effect/Stream#orElseEither: |
| 267 | replacement: "Stream.catch" |
| 268 | note: "Removed; Either is replaced by Result in v4. Emulate: `Stream.map(self, Result.succeed).pipe(Stream.catch(() => Stream.map(that(), Result.fail)))` (same encoding v4 Stream.mergeResult uses)." |
| 269 | effect/Stream#orElseFail: |
| 270 | replacement: "Stream.mapError" |
| 271 | note: "Removed; it only replaced the failure value: `Stream.mapError(self, () => error())` or `Stream.catch(self, () => Stream.fail(error()))`." |
| 272 | effect/Stream#orElseIfEmptyChunk: |
| 273 | replacement: "Stream.orElseIfEmpty" |
| 274 | note: "Folded into Stream.orElseIfEmpty, which now takes a lazy fallback Stream: `Stream.orElseIfEmpty(self, () => Stream.fromArray(array))`; Chunk is replaced by plain arrays." |
| 275 | effect/Stream#orElseIfEmptyStream: |
| 276 | replacement: "Stream.orElseIfEmpty" |
| 277 | note: "Direct rename: v4 Stream.orElseIfEmpty takes a LazyArg<Stream> fallback, identical semantics." |
| 278 | effect/Stream#paginateChunk: |
| 279 | replacement: "Stream.paginate" |
| 280 | note: "v4 Stream.paginate is effectful and array-based: `paginate(s, (s) => Effect<readonly [ReadonlyArray<A>, Option<S>]>)`; wrap the pure step in Effect.succeed and use an array instead of a Chunk." |
| 281 | effect/Stream#paginateChunkEffect: |
| 282 | replacement: "Stream.paginate" |
| 283 | note: "v4 Stream.paginate has exactly this shape; only Chunk becomes ReadonlyArray." |
| 284 | effect/Stream#paginateEffect: |
| 285 | replacement: "Stream.paginate" |
| 286 | note: "v4 Stream.paginate emits a batch per step; wrap the single value in an array: `(s) => Effect.map(step(s), ([a, next]) => [[a], next])`." |
| 287 | effect/Stream#partitionEither: |
| 288 | replacement: "Stream.partitionEffect" |
| 289 | note: "Either-based split replaced by Filter.FilterEffect: the function now returns Effect<Result<Pass, Fail>> (Result.succeed/Result.fail instead of Either.right/left). Returns Effect<[passes, fails], never, R | Scope> — note the tuple is [passes, fails], v3 was [left, right]; options are { capacity?, concurrency? }." |
| 290 | effect/Stream#provideLayer: |
| 291 | replacement: "Stream.provide" |
| 292 | note: "v4 Stream.provide accepts a Layer or a Context; behavior identical." |
| 293 | effect/Stream#provideServiceStream: |
| 294 | replacement: "none" |
| 295 | note: "Removed; v4 has provideService/provideServiceEffect but no stream-valued variant. Emulate with `Stream.flatMap(services, (s) => Stream.provideService(self, tag, s))` over the service stream, or use Stream.provideServiceEffect for effectful acquisition." |
| 296 | effect/Stream#provideSomeContext: |
| 297 | replacement: "Stream.provideContext" |
| 298 | note: "v4 Stream.provideContext is the single Context provider with `Exclude<R, R2>` semantics — same behavior as v3 provideSomeContext." |
| 299 | effect/Stream#provideSomeLayer: |
| 300 | replacement: "Stream.provide" |
| 301 | note: "v4 Stream.provide accepts a Layer (or Context) and excludes only the provided services from R — same partial-provision semantics." |
| 302 | effect/Stream#refineOrDie: |
| 303 | replacement: "Stream.catch" |
| 304 | note: "Removed; emulate with `Stream.catch(self, (e) => { const r = pf(e); return Option.isSome(r) ? Stream.fail(r.value) : Stream.die(e) })` — refail refined errors, die on the rest." |
| 305 | effect/Stream#refineOrDieWith: |
| 306 | replacement: "Stream.catch" |
| 307 | note: "Removed; same as refineOrDie but die with the mapped defect: `Stream.die(f(e))` for unrefined errors." |
| 308 | effect/Stream#repeatEffect: |
| 309 | replacement: "Stream.fromEffectRepeat" |
| 310 | note: "Renamed; repeats the effect forever emitting each result." |
| 311 | effect/Stream#repeatEffectChunk: |
| 312 | replacement: "Stream.fromIterableEffectRepeat" |
| 313 | note: "Renamed; the effect now produces an Iterable/array instead of a Chunk, repeated forever." |
| 314 | effect/Stream#repeatEffectChunkOption: |
| 315 | replacement: "Stream.fromIterableEffectRepeat" |
| 316 | note: "The Option<E> error encoding is gone: end the stream by failing the effect with `Cause.done()` (a Cause.Done failure); Done is excluded from the resulting stream's error type (Pull.ExcludeDone<E>)." |
| 317 | effect/Stream#repeatEffectOption: |
| 318 | replacement: "Stream.fromEffectRepeat" |
| 319 | note: "The Option<E> error encoding is gone: fail the effect with `Cause.done()` instead of Option.none() to end the stream; other failures propagate as stream errors." |
| 320 | effect/Stream#repeatEffectWithSchedule: |
| 321 | replacement: "Stream.fromEffectSchedule" |
| 322 | note: "Renamed; runs the effect once, then repeats it per the schedule, emitting each result." |
| 323 | effect/Stream#repeatEither: |
| 324 | replacement: "none" |
| 325 | note: "Removed; v4 Stream.repeat(schedule) repeats the stream but never emits the schedule outputs, and no Either/unification variant exists. If schedule outputs must be observed, hand-roll with Channel or track them via a schedule that taps into a Ref." |
| 326 | effect/Stream#repeatElementsWith: |
| 327 | replacement: "none" |
| 328 | note: "Removed; v4 Stream.repeatElements(schedule) repeats each element per the schedule but never emits schedule outputs — the onElement/onSchedule unification is gone. Use repeatElements if only element repetition is needed." |
| 329 | effect/Stream#repeatValue: |
| 330 | replacement: "Stream.fromEffectRepeat" |
| 331 | note: "Removed; use `Stream.fromEffectRepeat(Effect.succeed(value))` or `Stream.forever(Stream.succeed(value))`." |
| 332 | effect/Stream#repeatWith: |
| 333 | replacement: "none" |
| 334 | note: "Removed; v4 Stream.repeat(schedule) covers the repetition but drops the schedule outputs and the onElement/onSchedule unification. Hand-roll if schedule outputs must appear in the stream." |
| 335 | effect/Stream#runFoldScoped: |
| 336 | replacement: "Stream.runFold" |
| 337 | note: "Scoped run variants are gone; v4 run functions manage the stream's scope internally and the initial value is now a LazyArg: `Stream.runFold(self, () => s, f)`. For enclosing-scope control, pull manually via `Stream.toPull` (Effect<Pull, never, R | Scope>)." |
| 338 | effect/Stream#runFoldScopedEffect: |
| 339 | replacement: "Stream.runFoldEffect" |
| 340 | note: "Scoped run variants are gone; use `Stream.runFoldEffect(self, () => s, f)` — scope is managed internally, initial value is a LazyArg. Use Stream.toPull for manual scoped consumption." |
| 341 | effect/Stream#runFoldWhile: |
| 342 | replacement: "none" |
| 343 | note: "v4 runFold has no early-exit predicate; emulate with Stream.runForEachWhile and a mutable accumulator." |
| 344 | example: | |
| 345 | // v3: Stream.runFoldWhile(self, init, cont, f) |
| 346 | Effect.suspend(() => { |
| 347 | let acc = init |
| 348 | return Stream.runForEachWhile(self, (a) => { |
| 349 | acc = f(acc, a) |
| 350 | return Effect.succeed(cont(acc)) |
| 351 | }).pipe(Effect.map(() => acc)) |
| 352 | }) |
| 353 | effect/Stream#runFoldWhileEffect: |
| 354 | replacement: "none" |
| 355 | note: "v4 runFoldEffect has no early-exit predicate; emulate with Stream.runForEachWhile and a mutable accumulator, mapping the effectful step to Effect<boolean> via cont(acc) (see runFoldWhile example)." |
| 356 | effect/Stream#runFoldWhileScoped: |
| 357 | replacement: "none" |
| 358 | note: "Both the while-predicate and the scoped run variants are gone in v4; emulate the predicate with Stream.runForEachWhile plus a mutable accumulator (see runFoldWhile); scope is managed internally by v4 run functions." |
| 359 | effect/Stream#runFoldWhileScopedEffect: |
| 360 | replacement: "none" |
| 361 | note: "Both the while-predicate and the scoped run variants are gone in v4; emulate with Stream.runForEachWhile plus a mutable accumulator and effectful step; scope is managed internally by v4 run functions." |
| 362 | effect/Stream#runForEachChunk: |
| 363 | replacement: "Stream.runForEachArray" |
| 364 | note: "Renamed; the callback receives a NonEmptyReadonlyArray instead of a Chunk." |
| 365 | effect/Stream#runForEachChunkScoped: |
| 366 | replacement: "Stream.runForEachArray" |
| 367 | note: "Scoped run variants are gone; v4 runForEachArray manages the stream scope internally. Use Stream.toPull for manual scoped consumption." |
| 368 | effect/Stream#runForEachScoped: |
| 369 | replacement: "Stream.runForEach" |
| 370 | note: "Scoped run variants are gone; v4 runForEach manages the stream scope internally. Use Stream.toPull for manual scoped consumption." |
| 371 | effect/Stream#runForEachWhileScoped: |
| 372 | replacement: "Stream.runForEachWhile" |
| 373 | note: "Scoped run variants are gone; v4 runForEachWhile (callback returns Effect<boolean>) manages the stream scope internally." |
| 374 | effect/Stream#runIntoPubSubScoped: |
| 375 | replacement: "Stream.runIntoPubSub" |
| 376 | note: "Scoped variant removed; v4 runIntoPubSub(pubsub, { shutdownOnEnd? }) publishes plain values (the Take wrapper is gone) and does not require Scope — fork the returned effect (Effect.forkIn/Effect.forkScoped) to reproduce the background scoped behavior." |
| 377 | effect/Stream#runIntoQueueElementsScoped: |
| 378 | replacement: "Stream.runIntoQueue" |
| 379 | note: "The per-element Exit<A, Option<E>> encoding is gone; v4 runIntoQueue targets a Queue<A, E | Cause.Done> — elements are offered plainly and failure/end are signalled through the queue's error/done channel. Fork with Effect.forkIn for scoped background running." |
| 380 | effect/Stream#runIntoQueueScoped: |
| 381 | replacement: "Stream.runIntoQueue" |
| 382 | note: "Scoped variant removed; v4 runIntoQueue offers plain values to a Queue<A, E | Cause.Done> (Take wrapper gone) and requires no Scope — fork the returned effect into a scope (Effect.forkIn) if needed." |
| 383 | effect/Stream#runScoped: |
| 384 | replacement: "Stream.run" |
| 385 | note: "Scoped variant removed; v4 Stream.run(sink) manages the stream's scope internally. For consumption tied to an enclosing Scope, use Stream.toPull and drive the Pull manually." |
| 386 | effect/Stream#scanReduce: |
| 387 | replacement: "Stream.mapAccum" |
| 388 | note: "Removed; emulate first-element-as-seed with `Stream.mapAccum(self, () => undefined as A | undefined, (acc, a) => { const next = acc === undefined ? a : f(acc, a); return [next, [next]] })`." |
| 389 | effect/Stream#scanReduceEffect: |
| 390 | replacement: "Stream.mapAccumEffect" |
| 391 | note: "Removed; same first-element-as-seed emulation as scanReduce but with Stream.mapAccumEffect and an effectful step." |
| 392 | effect/Stream#scheduleWith: |
| 393 | replacement: "none" |
| 394 | note: "Removed; v4 Stream.schedule(schedule) only paces elements and never emits schedule outputs — the onElement/onSchedule unification is gone. Use Stream.schedule if only pacing is needed." |
| 395 | effect/Stream#scopedWith: |
| 396 | replacement: "Stream.scoped" |
| 397 | note: "Removed; v4 Stream.scoped scopes a Stream (provides a Scope kept open for the stream's lifetime). Emulate: `Stream.scoped(Stream.fromEffect(Effect.flatMap(Effect.scope, f)))` — Effect.scope accesses the ambient Scope." |
| 398 | effect/Stream#some: |
| 399 | replacement: "none" |
| 400 | note: "Removed along with Option<E> error encodings. To drop None values use `Stream.filterMap(self, Filter.fromPredicateOption((o) => o))`; to fail on None use Stream.mapEffect with Option.match into Effect.fail/Effect.succeed." |
| 401 | effect/Stream#someOrElse: |
| 402 | replacement: "Stream.map" |
| 403 | note: "Removed; use `Stream.map(self, Option.getOrElse(() => fallback()))`." |
| 404 | effect/Stream#someOrFail: |
| 405 | replacement: "Stream.mapEffect" |
| 406 | note: "Removed; use `Stream.mapEffect(self, Option.match({ onNone: () => Effect.fail(error()), onSome: Effect.succeed }))`." |
| 407 | effect/Stream#splitOnChunk: |
| 408 | replacement: "none" |
| 409 | note: "Delimiter-subsequence splitting was removed; v4 keeps only Stream.split (predicate/refinement, emitting NonEmptyReadonlyArray segments) and Stream.splitLines. Hand-roll multi-element delimiter splitting with Stream.mapAccumArray." |
| 410 | effect/Stream#tapErrorCause: |
| 411 | replacement: "Stream.tapCause" |
| 412 | note: "Renamed; taps the full Cause on failure." |
| 413 | effect/Stream#timeoutFail: |
| 414 | replacement: "Stream.timeoutOrElse" |
| 415 | note: "Use `Stream.timeoutOrElse(self, { duration, orElse: () => Stream.fail(error()) })`; the timeout resets on every emitted value as before." |
| 416 | effect/Stream#timeoutFailCause: |
| 417 | replacement: "Stream.timeoutOrElse" |
| 418 | note: "Use `Stream.timeoutOrElse(self, { duration, orElse: () => Stream.failCause(cause()) })`." |
| 419 | effect/Stream#timeoutTo: |
| 420 | replacement: "Stream.timeoutOrElse" |
| 421 | note: "Renamed into an options form: `Stream.timeoutOrElse(self, { duration, orElse: () => that })` — the fallback stream is now lazy." |
| 422 | effect/Stream#toAsyncIterableRuntime: |
| 423 | replacement: "Stream.toAsyncIterableWith" |
| 424 | note: "Renamed; takes a `Context.Context<XR>` instead of a Runtime (v4 removed Runtime — a services Context is the execution environment). toAsyncIterable/toAsyncIterableEffect also still exist." |
| 425 | effect/Stream#toQueueOfElements: |
| 426 | replacement: "Stream.toQueue" |
| 427 | note: "The Exit<A, Option<E>>-per-element queue is gone; v4 toQueue(options: { capacity, strategy? }) returns Effect<Queue.Dequeue<A, E | Cause.Done>, never, R | Scope> — elements are plain values and failure/end arrive through the queue's error/done channel." |
| 428 | effect/Stream#toReadableStreamRuntime: |
| 429 | replacement: "Stream.toReadableStreamWith" |
| 430 | note: "Renamed; takes a `Context.Context<XR>` instead of a Runtime (v4 removed Runtime); options `{ strategy?: QueuingStrategy }` unchanged." |
| 431 | effect/Stream#transduce: |
| 432 | include: true |
| 433 | replacement: "Stream.transduce" |
| 434 | note: "Unchanged name and Sink-based shape; chunks are plain arrays in v4." |
| 435 | effect/Stream#unfoldChunk: |
| 436 | replacement: "Stream.paginate" |
| 437 | note: "Removed; v4 Stream.paginate(s, (s) => Effect<[ReadonlyArray<A>, Option<S>]>) is the array-emitting unfold — wrap the pure step in Effect.succeed; to end without emitting return `[[], Option.none()]`." |
| 438 | effect/Stream#unfoldChunkEffect: |
| 439 | replacement: "Stream.paginate" |
| 440 | note: "Removed; v4 Stream.paginate has the effectful array-step shape — map v3's Option<[Chunk, S]> result to `[array, Option<S>]`, returning `[[], Option.none()]` to end without emitting." |
| 441 | effect/Stream#unfoldEffect: |
| 442 | replacement: "Stream.unfold" |
| 443 | note: "v4 Stream.unfold is effectful: `unfold(s, (s) => Effect<readonly [A, S] | undefined>)` — return the pair or `undefined` to end instead of Option." |
| 444 | effect/Stream#unwrapScoped: |
| 445 | replacement: "Stream.unwrap" |
| 446 | note: "v4 Stream.unwrap accepts scoped effects (`Exclude<R, Scope>` built in); the scope stays open for the stream's lifetime — it replaces both unwrap and unwrapScoped." |
| 447 | effect/Stream#unwrapScopedWith: |
| 448 | replacement: "Stream.unwrap" |
| 449 | note: "Removed; access the ambient Scope explicitly: `Stream.unwrap(Effect.flatMap(Effect.scope, f))` — v4 unwrap keeps the scope open for the stream's lifetime." |
| 450 | effect/Stream#void: |
| 451 | replacement: "Stream.succeed(void 0)" |
| 452 | note: "The `Stream.void` constant (single void element) was removed; use `Stream.succeed(void 0)` or `Stream.make(void 0)`." |
| 453 | effect/Stream#whenCase: |
| 454 | replacement: "none" |
| 455 | note: "Removed; emulate with `Stream.suspend(() => Option.match(pf(evaluate()), { onNone: () => Stream.empty, onSome: (s) => s }))`." |
| 456 | effect/Stream#whenCaseEffect: |
| 457 | replacement: "none" |
| 458 | note: "Removed; emulate with `Stream.unwrap(Effect.map(self, (a) => Option.match(pf(a), { onNone: () => Stream.empty, onSome: (s) => s })))`." |
| 459 | effect/Stream#whenEffect: |
| 460 | replacement: "Stream.when" |
| 461 | note: "Folded into Stream.when, which now takes an `Effect<boolean>` test directly (wrap a pure condition with Effect.sync)." |
| 462 | effect/Stream#zipAll: |
| 463 | replacement: "none" |
| 464 | note: "The entire zipAll family was removed in v4 (only zip/zipLatest/zipLatestAll exist; zip ends at the shorter side, zipLatest* combine latest values — different semantics). Pad-with-default zipping must be hand-rolled, e.g. with Stream.combineArray pulling both sides." |
| 465 | effect/Stream#zipAllLeft: |
| 466 | replacement: "none" |
| 467 | note: "Removed with the zipAll family; no default-padding zip exists in v4. Hand-roll with Stream.combineArray (or concat the remainder after a plain Stream.zipLeft) if needed." |
| 468 | effect/Stream#zipAllRight: |
| 469 | replacement: "none" |
| 470 | note: "Removed with the zipAll family; no default-padding zip exists in v4. Hand-roll with Stream.combineArray if needed." |
| 471 | effect/Stream#zipAllSortedByKey: |
| 472 | replacement: "none" |
| 473 | note: "Removed; the sorted-by-key merge-join family has no v4 equivalent (checked v4 Stream exports — only zip/zipLatest/zipLatestAll/zipWithArray). Hand-roll a keyed merge with Stream.combineArray." |
| 474 | effect/Stream#zipAllSortedByKeyLeft: |
| 475 | replacement: "none" |
| 476 | note: "Removed; see zipAllSortedByKey — no keyed merge-join in v4, hand-roll with Stream.combineArray." |
| 477 | effect/Stream#zipAllSortedByKeyRight: |
| 478 | replacement: "none" |
| 479 | note: "Removed; see zipAllSortedByKey — no keyed merge-join in v4, hand-roll with Stream.combineArray." |
| 480 | effect/Stream#zipAllSortedByKeyWith: |
| 481 | replacement: "none" |
| 482 | note: "Removed; see zipAllSortedByKey — no keyed merge-join in v4, hand-roll with Stream.combineArray." |
| 483 | effect/Stream#zipAllWith: |
| 484 | replacement: "none" |
| 485 | note: "Removed with the zipAll family; v4 has no zip that pads the shorter side with defaults. Hand-roll with Stream.combineArray." |
| 486 | effect/Stream#zipWithChunks: |
| 487 | replacement: "Stream.zipWithArray" |
| 488 | note: "Renamed; the combiner now receives two NonEmptyReadonlyArrays and returns `[output: NonEmptyReadonlyArray, leftoverLeft: ReadonlyArray, leftoverRight: ReadonlyArray]` — the Either-wrapped leftover (ZipChunksResult) is replaced by the two explicit leftover arrays." |