Skip to content
Source
Sign inSign up

effect__Cause.yaml

214 lines14.9 KB

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 include: true
9 replacement: "Cause.Cause"
10 note: "V4 Cause<E> wraps readonly reasons: ReadonlyArray<Cause.Reason<E>>, replacing the v3 cause tree. Finalizer and concurrent failure aggregation can convert typed errors to defects when a defect is present; Cause.combine itself does not perform this conversion."
11effect/Cause#Cause.Variance:
12 replacement: "none"
13 note: "The public variance helper was removed. Cause.Cause is directly branded by Cause.TypeId; application code should not reproduce the old variance member."
14effect/Cause#CauseReducer:
15 replacement: "cause.reasons.reduce"
16 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."
17effect/Cause#CauseTypeId:
18 replacement: "Cause.TypeId"
19 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."
20effect/Cause#contains:
21 replacement: "Equal.equals(Cause.combine(self, that), self)"
22 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."
23effect/Cause#defects:
24 replacement: "self.reasons.filter(Cause.isDieReason).map((reason) => reason.defect)"
25 note: "Collect defect values from the flat Reason array. The result is a standard array rather than v3 Chunk."
26effect/Cause#Die:
27 replacement: "Cause.Die"
28 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."
29effect/Cause#dieOption:
30 replacement: "Cause.findDefect"
31 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."
32effect/Cause#Empty:
33 replacement: "Cause.empty"
34 note: "The Empty subtype and _tag were removed. Empty is Cause.empty, represented by cause.reasons.length === 0."
35effect/Cause#ExceededCapacityException:
36 replacement: "Cause.ExceededCapacityError"
37 note: "Rename the class/type and update the discriminant from ExceededCapacityException to ExceededCapacityError."
38effect/Cause#ExceededCapacityExceptionTypeId:
39 replacement: "Cause.ExceededCapacityErrorTypeId"
40 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.ExceededCapacityErrorTypeId in type positions."
41effect/Cause#Fail:
42 replacement: "Cause.Fail"
43 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."
44effect/Cause#failureOption:
45 replacement: "Cause.findErrorOption"
46 note: "Direct Option-based replacement for extracting the first typed Fail error value."
47effect/Cause#failureOrCause:
48 replacement: "Cause.findError"
49 note: "Use the v4 Result-based split: success is the first E and failure is the original Cause<never> when no Fail reason exists."
50effect/Cause#failures:
51 replacement: "self.reasons.filter(Cause.isFailReason).map((reason) => reason.error)"
52 note: "Collect typed error values from the flat Reason array. The result is a standard array rather than v3 Chunk."
53effect/Cause#filter:
54 replacement: "Cause.fromReasons(self.reasons.filter(...))"
55 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."
56effect/Cause#find:
57 replacement: "Option.firstSomeOf(self.reasons.map(...))"
58 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."
59effect/Cause#flatMap:
60 replacement: "Cause.fromReasons(self.reasons.flatMap((reason) => Cause.isFailReason(reason) ? f(reason.error).reasons : [reason]))"
61 note: "No direct v4 export. Flat-map only Fail reasons into replacement causes, preserve Die/Interrupt reasons, and rebuild from the resulting Reason array."
62effect/Cause#flatten:
63 replacement: "Cause.fromReasons(self.reasons.flatMap((reason) => Cause.isFailReason(reason) ? reason.error.reasons : [reason]))"
64 note: "No direct v4 export. For Cause<Cause<E>>, splice each Fail reason's nested cause.reasons and retain Die/Interrupt reasons."
65effect/Cause#flipCauseOption:
66 replacement: "Cause.fromReasons + Option"
67 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."
68effect/Cause#IllegalArgumentException:
69 replacement: "Cause.IllegalArgumentError"
70 note: "Rename the class/type and update the discriminant from IllegalArgumentException to IllegalArgumentError."
71effect/Cause#IllegalArgumentExceptionTypeId:
72 replacement: "Cause.IllegalArgumentErrorTypeId"
73 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.IllegalArgumentErrorTypeId in type positions."
74effect/Cause#Interrupt:
75 replacement: "Cause.Interrupt"
76 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."
77effect/Cause#InterruptedException:
78 replacement: "none"
79 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."
80effect/Cause#InterruptedExceptionTypeId:
81 replacement: "none"
82 note: "Removed with InterruptedException; v4 exports no interruption-error brand. Inspect the Cause with Cause.hasInterrupts or Cause.hasInterruptsOnly instead."
83effect/Cause#interruptOption:
84 replacement: "Cause.findInterrupt"
85 note: "The replacement returns Result.Result<Cause.Interrupt, Cause.Cause<E>> rather than Option<FiberId>; on success read reason.fiberId, now number | undefined."
86effect/Cause#InvalidPubSubCapacityException:
87 replacement: "Error"
88 note: "The dedicated public type was removed. Current v4 PubSub capacity validation throws a standard global Error with the capacity message."
89effect/Cause#InvalidPubSubCapacityExceptionTypeId:
90 replacement: "none"
91 note: "Removed with InvalidPubSubCapacityException; the standard Error now thrown by PubSub has no Effect-specific brand."
92effect/Cause#isDie:
93 replacement: "Cause.hasDies"
94 note: "Use the v4 cause-level predicate for the presence of at least one Die reason."
95effect/Cause#isDieType:
96 replacement: "Cause.isDieReason"
97 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer a Die union variant."
98effect/Cause#isEmpty:
99 replacement: "self.reasons.length === 0"
100 note: "V4 represents an empty cause with an empty reasons array and exports no isEmpty function."
101effect/Cause#isEmptyType:
102 replacement: "self.reasons.length === 0"
103 note: "The check remains possible, but there is no Empty subtype to narrow to because v4 Cause is not a variant union."
104effect/Cause#isExceededCapacityException:
105 replacement: "Cause.isExceededCapacityError"
106 note: "Rename the guard along with ExceededCapacityError."
107effect/Cause#isFailType:
108 replacement: "Cause.isFailReason"
109 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer a Fail union variant."
110effect/Cause#isFailure:
111 replacement: "Cause.hasFails"
112 note: "Use the v4 cause-level predicate for the presence of at least one Fail reason."
113effect/Cause#isIllegalArgumentException:
114 replacement: "Cause.isIllegalArgumentError"
115 note: "Rename the guard along with IllegalArgumentError."
116effect/Cause#isInterrupted:
117 replacement: "Cause.hasInterrupts"
118 note: "Use the v4 cause-level predicate for the presence of at least one Interrupt reason."
119effect/Cause#isInterruptedException:
120 replacement: "none"
121 note: "No v4 InterruptError class or unknown-value guard is exported. When the Cause is available, test Cause.hasInterruptsOnly before squashing or rendering it."
122effect/Cause#isInterruptedOnly:
123 replacement: "Cause.hasInterruptsOnly"
124 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."
125effect/Cause#isInterruptType:
126 replacement: "Cause.isInterruptReason"
127 note: "Apply this guard to an entry of cause.reasons; Cause itself is no longer an Interrupt union variant."
128effect/Cause#isNoSuchElementException:
129 replacement: "Cause.isNoSuchElementError"
130 note: "Rename the guard along with NoSuchElementError."
131effect/Cause#isParallelType:
132 replacement: "none"
133 note: "Parallel cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
134effect/Cause#isRuntimeException:
135 replacement: "none"
136 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."
137effect/Cause#isSequentialType:
138 replacement: "none"
139 note: "Sequential cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
140effect/Cause#isTimeoutException:
141 replacement: "Cause.isTimeoutError"
142 note: "Rename the guard along with TimeoutError."
143effect/Cause#isUnknownException:
144 replacement: "Cause.isUnknownError"
145 note: "Rename the guard along with UnknownError."
146effect/Cause#keepDefects:
147 replacement: "Cause.fromReasons(self.reasons.filter(Cause.isDieReason))"
148 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."
149effect/Cause#linearize:
150 replacement: "self.reasons"
151 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."
152effect/Cause#NoSuchElementException:
153 replacement: "Cause.NoSuchElementError"
154 note: "Rename the class/type and update the discriminant from NoSuchElementException to NoSuchElementError."
155effect/Cause#NoSuchElementExceptionTypeId:
156 replacement: "Cause.NoSuchElementErrorTypeId"
157 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.NoSuchElementErrorTypeId in type positions."
158effect/Cause#originalError:
159 replacement: "Function.identity"
160 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."
161effect/Cause#parallel:
162 replacement: "Cause.combine"
163 note: "Combine the two flat reason arrays; v4 intentionally no longer records whether composition was parallel or sequential."
164effect/Cause#Parallel:
165 replacement: "none"
166 note: "Parallel cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
167effect/Cause#PrettyError:
168 replacement: "Error"
169 note: "Cause.prettyErrors now returns Array<globalThis.Error>. The dedicated span field is gone; tracing information is incorporated from Reason annotations into rendered stacks."
170effect/Cause#reduce:
171 replacement: "self.reasons.reduce"
172 note: "Reduce the flat Reason array directly. The callback now sees only Fail, Die, and Interrupt reasons, never Empty or composition nodes."
173effect/Cause#reduceWithContext:
174 replacement: "self.reasons.reduce"
175 note: "Capture the context in the reducer closure and reduce the flat Reason array; sequentialCase and parallelCase have no v4 analogue."
176effect/Cause#RuntimeException:
177 replacement: "Error"
178 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."
179effect/Cause#RuntimeExceptionTypeId:
180 replacement: "none"
181 note: "Removed with RuntimeException. Define and guard a custom Data.Error/Data.TaggedError type if nominal branding is required."
182effect/Cause#sequential:
183 replacement: "Cause.combine"
184 note: "Combine the two flat reason arrays; v4 intentionally no longer records whether composition was parallel or sequential."
185effect/Cause#Sequential:
186 replacement: "none"
187 note: "Sequential cause nodes were removed; v4 stores all reasons in one flat array and does not retain composition kind."
188effect/Cause#size:
189 replacement: "self.reasons.length"
190 note: "The v3 node count becomes the number of flat reasons in v4."
191effect/Cause#squashWith:
192 replacement: "Result.match(Cause.findError(self), { onSuccess: f, onFailure: Cause.squash })"
193 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."
194effect/Cause#stripFailures:
195 replacement: "Cause.fromReasons(self.reasons.filter((reason) => !Cause.isFailReason(reason)))"
196 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."
197effect/Cause#stripSomeDefects:
198 replacement: "Cause.fromReasons + Option"
199 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."
200effect/Cause#TimeoutException:
201 replacement: "Cause.TimeoutError"
202 note: "Rename the class/type and update the discriminant from TimeoutException to TimeoutError."
203effect/Cause#TimeoutExceptionTypeId:
204 replacement: "Cause.TimeoutErrorTypeId"
205 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.TimeoutErrorTypeId in type positions."
206effect/Cause#UnknownException:
207 replacement: "Cause.UnknownError"
208 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."
209effect/Cause#UnknownExceptionTypeId:
210 replacement: "Cause.UnknownErrorTypeId"
211 note: "Rename the brand; v4 exports a literal-string const, so use typeof Cause.UnknownErrorTypeId in type positions."
212effect/Cause#YieldableError:
213 replacement: "Cause.YieldableError / Data.Error"
214 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."