1effect/Cause#andThen:
2 replacement: "Cause.fromReasons(self.reasons.flatMap(...))"
3 note: "No direct v4 combinator. For each Fail reason, splice either f(reason.error).reasons or the constant cause's reasons; retain Die and Interrupt reasons, then rebuild with Cause.fromReasons."
4effect/Cause#as:
5 replacement: "Cause.map(self, () => error)"
6 note: "Use Cause.map with a constant function; only Fail errors change and Die/Interrupt reasons remain."
7effect/Cause#Cause:
8 replacement: "Cause.Cause"
9 note: "The name remains, but v4 Cause<E> is a wrapper with readonly reasons: ReadonlyArray<Cause.Reason<E>>, not the v3 Empty/Fail/Die/Interrupt/Sequential/Parallel tree."
10effect/Cause#Cause.Variance:
11 replacement: "none"
12 note: "The public variance helper was removed. Cause.Cause is directly branded by Cause.TypeId; application code should not reproduce the old variance member."
13effect/Cause#CauseReducer:
14 replacement: "cause.reasons.reduce"
15 note: "The six-case tree reducer type was removed with Empty, Sequential, and Parallel. Reduce the flat Reason array and switch on Fail, Die, or Interrupt instead."
16effect/Cause#CauseTypeId:
17 replacement: "Cause.TypeId"
18 note: "The brand export is Cause.TypeId, a literal-string const. Use typeof Cause.TypeId in type positions; the v3 unique-symbol CauseTypeId alias is gone."
19effect/Cause#contains:
20 replacement: "Equal.equals(Cause.combine(self, that), self)"
21 note: "There are no subtrees in v4. This tests whether all reasons from that are already present in self under v4 reason equality; use Equal.equals(self, that) when only whole-cause equality is intended."
22effect/Cause#defects:
23 replacement: "self.reasons.filter(Cause.isDieReason).map((reason) => reason.defect)"
24 note: "Collect defect values from the flat Reason array. The result is a standard array rather than v3 Chunk."
25effect/Cause#Die:
26 replacement: "Cause.Die"
27 note: "The name remains, but Cause.Die is now a Reason stored in cause.reasons, not a Cause variant. Construct a standalone reason with Cause.makeDieReason or a cause with Cause.die."
28effect/Cause#dieOption:
29 replacement: "Cause.findDefect"
30 note: "Cause.findDefect returns Result.Result<unknown, Cause.Cause<E>>, not Option. Match the Result or convert it to Option when the old return shape is required."
31effect/Cause#Empty:
32 replacement: "Cause.empty"
33 note: "The Empty subtype and _tag were removed. Empty is Cause.empty, represented by cause.reasons.length === 0."
34effect/Cause#ExceededCapacityException:
35 replacement: "Cause.ExceededCapacityError"
36 note: "Rename the class/type and update the discriminant from ExceededCapacityException to ExceededCapacityError."
37effect/Cause#ExceededCapacityExceptionTypeId:
38 replacement: "Cause.ExceededCapacityErrorTypeId"
39 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.ExceededCapacityErrorTypeId in type positions."
40effect/Cause#Fail:
41 replacement: "Cause.Fail"
42 note: "The name remains, but Cause.Fail<E> is now a Reason stored in cause.reasons, not a Cause variant. Construct a standalone reason with Cause.makeFailReason or a cause with Cause.fail."
43effect/Cause#failureOption:
44 replacement: "Cause.findErrorOption"
45 note: "Direct Option-based replacement for extracting the first typed Fail error value."
46effect/Cause#failureOrCause:
47 replacement: "Cause.findError"
48 note: "Use the v4 Result-based split: success is the first E and failure is the original Cause<never> when no Fail reason exists."
49effect/Cause#failures:
50 replacement: "self.reasons.filter(Cause.isFailReason).map((reason) => reason.error)"
51 note: "Collect typed error values from the flat Reason array. The result is a standard array rather than v3 Chunk."
52effect/Cause#filter:
53 replacement: "Cause.fromReasons(self.reasons.filter(...))"
54 note: "No exact tree-level equivalent: v3 predicates selected recursive child causes. Rewrite the predicate for Cause.Reason values, filter cause.reasons, and rebuild with Cause.fromReasons."
55effect/Cause#find:
56 replacement: "Option.firstSomeOf(self.reasons.map(...))"
57 note: "No recursive nodes remain. Apply the partial function to Reason values and take the first Some, or use Cause.findFail/findError/findDie/findDefect/findInterrupt for standard searches."
58effect/Cause#flatMap:
59 replacement: "Cause.fromReasons(self.reasons.flatMap((reason) => Cause.isFailReason(reason) ? f(reason.error).reasons : [reason]))"
60 note: "No direct v4 export. Flat-map only Fail reasons into replacement causes, preserve Die/Interrupt reasons, and rebuild from the resulting Reason array."
61effect/Cause#flatten:
62 replacement: "Cause.fromReasons(self.reasons.flatMap((reason) => Cause.isFailReason(reason) ? reason.error.reasons : [reason]))"
63 note: "No direct v4 export. For Cause<Cause<E>>, splice each Fail reason's nested cause.reasons and retain Die/Interrupt reasons."
64effect/Cause#flipCauseOption:
65 replacement: "Cause.fromReasons + Option"
66 note: "Rewrite over reasons: drop Fail(None), replace Fail(Some(e)) with Cause.makeFailReason(e), retain Die/Interrupt, then return None only when a non-empty input loses every reason; preserve Some(Cause.empty) for an empty input."
67effect/Cause#IllegalArgumentException:
68 replacement: "Cause.IllegalArgumentError"
69 note: "Rename the class/type and update the discriminant from IllegalArgumentException to IllegalArgumentError."
70effect/Cause#IllegalArgumentExceptionTypeId:
71 replacement: "Cause.IllegalArgumentErrorTypeId"
72 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.IllegalArgumentErrorTypeId in type positions."
73effect/Cause#Interrupt:
74 replacement: "Cause.Interrupt"
75 note: "The name remains, but it is now a Reason in cause.reasons rather than a Cause variant, and fiberId changed from FiberId.FiberId to number | undefined. Use Cause.makeInterruptReason or Cause.interrupt."
76effect/Cause#InterruptedException:
77 replacement: "none"
78 note: "The public exception class was removed. Represent cancellation with Cause.interrupt; Cause.prettyErrors creates an ordinary Error named InterruptError for interrupt-only rendering, but no class is exported."
79effect/Cause#InterruptedExceptionTypeId:
80 replacement: "none"
81 note: "Removed with InterruptedException; v4 exports no interruption-error brand. Inspect the Cause with Cause.hasInterrupts or Cause.hasInterruptsOnly instead."
82effect/Cause#interruptOption:
83 replacement: "Cause.findInterrupt"
84 note: "The replacement returns Result.Result<Cause.Interrupt, Cause.Cause<E>> rather than Option<FiberId>; on success read reason.fiberId, now number | undefined."
85effect/Cause#InvalidPubSubCapacityException:
86 replacement: "Error"
87 note: "The dedicated public type was removed. Current v4 PubSub capacity validation throws a standard global Error with the capacity message."
88effect/Cause#InvalidPubSubCapacityExceptionTypeId:
89 replacement: "none"
90 note: "Removed with InvalidPubSubCapacityException; the standard Error now thrown by PubSub has no Effect-specific brand."
91effect/Cause#isDie:
92 replacement: "Cause.hasDies"
93 note: "Use the v4 cause-level predicate for the presence of at least one Die reason."
94effect/Cause#isDieType:
95 replacement: "Cause.isDieReason"
96 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer a Die union variant."
97effect/Cause#isEmpty:
98 replacement: "self.reasons.length === 0"
99 note: "V4 represents an empty cause with an empty reasons array and exports no isEmpty function."
100effect/Cause#isEmptyType:
101 replacement: "self.reasons.length === 0"
102 note: "The check remains possible, but there is no Empty subtype to narrow to because v4 Cause is not a variant union."
103effect/Cause#isExceededCapacityException:
104 replacement: "Cause.isExceededCapacityError"
105 note: "Rename the guard along with ExceededCapacityError."
106effect/Cause#isFailType:
107 replacement: "Cause.isFailReason"
108 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer a Fail union variant."
109effect/Cause#isFailure:
110 replacement: "Cause.hasFails"
111 note: "Use the v4 cause-level predicate for the presence of at least one Fail reason."
112effect/Cause#isIllegalArgumentException:
113 replacement: "Cause.isIllegalArgumentError"
114 note: "Rename the guard along with IllegalArgumentError."
115effect/Cause#isInterrupted:
116 replacement: "Cause.hasInterrupts"
117 note: "Use the v4 cause-level predicate for the presence of at least one Interrupt reason."
118effect/Cause#isInterruptedException:
119 replacement: "none"
120 note: "No v4 InterruptError class or unknown-value guard is exported. When the Cause is available, test Cause.hasInterruptsOnly before squashing or rendering it."
121effect/Cause#isInterruptedOnly:
122 replacement: "Cause.hasInterruptsOnly"
123 note: "Direct cause-level rename; it is false for Cause.empty and true only when at least one reason exists and every reason is Interrupt."
124effect/Cause#isInterruptType:
125 replacement: "Cause.isInterruptReason"
126 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer an Interrupt union variant."
127effect/Cause#isNoSuchElementException:
128 replacement: "Cause.isNoSuchElementError"
129 note: "Rename the guard along with NoSuchElementError."
130effect/Cause#isParallelType:
131 replacement: "none"
132 note: "Parallel cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
133effect/Cause#isRuntimeException:
134 replacement: "none"
135 note: "RuntimeException and its brand were removed. Use instanceof Error for generic errors or define a Data.Error/Data.TaggedError class with its own guard when nominal recognition is required."
136effect/Cause#isSequentialType:
137 replacement: "none"
138 note: "Sequential cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
139effect/Cause#isTimeoutException:
140 replacement: "Cause.isTimeoutError"
141 note: "Rename the guard along with TimeoutError."
142effect/Cause#isUnknownException:
143 replacement: "Cause.isUnknownError"
144 note: "Rename the guard along with UnknownError."
145effect/Cause#keepDefects:
146 replacement: "Cause.fromReasons(self.reasons.filter(Cause.isDieReason))"
147 note: "Keep every Die reason, not merely the first defect. Return Option.none when the filtered array is empty and Option.some of the rebuilt cause otherwise; Cause.findDefect alone is not behaviorally equivalent."
148effect/Cause#linearize:
149 replacement: "self.reasons"
150 note: "No direct replacement: v4 discarded sequential/parallel structure, so there are no parallel branches to linearize. Rewrite the consumer to process the flat Reason array."
151effect/Cause#NoSuchElementException:
152 replacement: "Cause.NoSuchElementError"
153 note: "Rename the class/type and update the discriminant from NoSuchElementException to NoSuchElementError."
154effect/Cause#NoSuchElementExceptionTypeId:
155 replacement: "Cause.NoSuchElementErrorTypeId"
156 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.NoSuchElementErrorTypeId in type positions."
157effect/Cause#originalError:
158 replacement: "Function.identity"
159 note: "V3 used this to unwrap span-capture proxies. V4 stores tracing data on Reason.annotations and no longer proxies errors, so the input is already the original value."
160effect/Cause#parallel:
161 replacement: "Cause.combine"
162 note: "Combine the two flat reason arrays; v4 intentionally no longer records whether composition was parallel or sequential."
163effect/Cause#Parallel:
164 replacement: "none"
165 note: "Parallel cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
166effect/Cause#PrettyError:
167 replacement: "Error"
168 note: "Cause.prettyErrors now returns Array<globalThis.Error>. The dedicated span field is gone; tracing information is incorporated from Reason annotations into rendered stacks."
169effect/Cause#reduce:
170 replacement: "self.reasons.reduce"
171 note: "Reduce the flat Reason array directly. The callback now sees only Fail, Die, and Interrupt reasons, never Empty or composition nodes."
172effect/Cause#reduceWithContext:
173 replacement: "self.reasons.reduce"
174 note: "Capture the context in the reducer closure and reduce the flat Reason array; sequentialCase and parallelCase have no v4 analogue."
175effect/Cause#RuntimeException:
176 replacement: "Error"
177 note: "The dedicated class was removed and v4 uses global Error for generic defects. Use Data.Error or Data.TaggedError instead when a yieldable typed error is required."
178effect/Cause#RuntimeExceptionTypeId:
179 replacement: "none"
180 note: "Removed with RuntimeException. Define and guard a custom Data.Error/Data.TaggedError type if nominal branding is required."
181effect/Cause#sequential:
182 replacement: "Cause.combine"
183 note: "Combine the two flat reason arrays; v4 intentionally no longer records whether composition was parallel or sequential."
184effect/Cause#Sequential:
185 replacement: "none"
186 note: "Sequential cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
187effect/Cause#size:
188 replacement: "self.reasons.length"
189 note: "The v3 node count becomes the number of flat reasons in v4."
190effect/Cause#squashWith:
191 replacement: "Result.match(Cause.findError(self), { onSuccess: f, onFailure: Cause.squash })"
192 note: "Apply f only to the first typed Fail error; if no Fail exists, squash the returned Cause<never>. This preserves v3's priority and avoids evaluating f for later Fail reasons."
193effect/Cause#stripFailures:
194 replacement: "Cause.fromReasons(self.reasons.filter((reason) => !Cause.isFailReason(reason)))"
195 note: "Remove Fail reasons and retain Die plus Interrupt reasons, then rebuild the cause. The v3 prose saying interrupts were removed did not match its implementation."
196effect/Cause#stripSomeDefects:
197 replacement: "Cause.fromReasons + Option"
198 note: "Filter out each Die reason for which pf(reason.defect) is Some, retain all other reasons, and rebuild. Return None only when a non-empty input loses every reason; preserve Some(Cause.empty) for empty input."
199effect/Cause#TimeoutException:
200 replacement: "Cause.TimeoutError"
201 note: "Rename the class/type and update the discriminant from TimeoutException to TimeoutError."
202effect/Cause#TimeoutExceptionTypeId:
203 replacement: "Cause.TimeoutErrorTypeId"
204 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.TimeoutErrorTypeId in type positions."
205effect/Cause#UnknownException:
206 replacement: "Cause.UnknownError"
207 note: "Rename the class/type and discriminant. The original unknown value is now exposed through the standard Error.cause property, not v3's .error field."
208effect/Cause#UnknownExceptionTypeId:
209 replacement: "Cause.UnknownErrorTypeId"
210 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.UnknownErrorTypeId in type positions."
211effect/Cause#YieldableError:
212 replacement: "Cause.YieldableError / Data.Error"
213 note: "Cause.YieldableError remains as the interface/type, but its public constructor value was removed. Extend Data.Error for an untagged yieldable error or Data.TaggedError for a tagged one."