| 1 | effect/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." |
| 4 | effect/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." |
| 7 | effect/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." |
| 10 | effect/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." |
| 13 | effect/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." |
| 16 | effect/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." |
| 19 | effect/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." |
| 22 | effect/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." |
| 25 | effect/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." |
| 28 | effect/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." |
| 31 | effect/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." |
| 34 | effect/Cause#ExceededCapacityException: |
| 35 | replacement: "Cause.ExceededCapacityError" |
| 36 | note: "Rename the class/type and update the discriminant from ExceededCapacityException to ExceededCapacityError." |
| 37 | effect/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." |
| 40 | effect/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." |
| 43 | effect/Cause#failureOption: |
| 44 | replacement: "Cause.findErrorOption" |
| 45 | note: "Direct Option-based replacement for extracting the first typed Fail error value." |
| 46 | effect/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." |
| 49 | effect/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." |
| 52 | effect/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." |
| 55 | effect/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." |
| 58 | effect/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." |
| 61 | effect/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." |
| 64 | effect/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." |
| 67 | effect/Cause#IllegalArgumentException: |
| 68 | replacement: "Cause.IllegalArgumentError" |
| 69 | note: "Rename the class/type and update the discriminant from IllegalArgumentException to IllegalArgumentError." |
| 70 | effect/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." |
| 73 | effect/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." |
| 76 | effect/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." |
| 79 | effect/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." |
| 82 | effect/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." |
| 85 | effect/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." |
| 88 | effect/Cause#InvalidPubSubCapacityExceptionTypeId: |
| 89 | replacement: "none" |
| 90 | note: "Removed with InvalidPubSubCapacityException; the standard Error now thrown by PubSub has no Effect-specific brand." |
| 91 | effect/Cause#isDie: |
| 92 | replacement: "Cause.hasDies" |
| 93 | note: "Use the v4 cause-level predicate for the presence of at least one Die reason." |
| 94 | effect/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." |
| 97 | effect/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." |
| 100 | effect/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." |
| 103 | effect/Cause#isExceededCapacityException: |
| 104 | replacement: "Cause.isExceededCapacityError" |
| 105 | note: "Rename the guard along with ExceededCapacityError." |
| 106 | effect/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." |
| 109 | effect/Cause#isFailure: |
| 110 | replacement: "Cause.hasFails" |
| 111 | note: "Use the v4 cause-level predicate for the presence of at least one Fail reason." |
| 112 | effect/Cause#isIllegalArgumentException: |
| 113 | replacement: "Cause.isIllegalArgumentError" |
| 114 | note: "Rename the guard along with IllegalArgumentError." |
| 115 | effect/Cause#isInterrupted: |
| 116 | replacement: "Cause.hasInterrupts" |
| 117 | note: "Use the v4 cause-level predicate for the presence of at least one Interrupt reason." |
| 118 | effect/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." |
| 121 | effect/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." |
| 124 | effect/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." |
| 127 | effect/Cause#isNoSuchElementException: |
| 128 | replacement: "Cause.isNoSuchElementError" |
| 129 | note: "Rename the guard along with NoSuchElementError." |
| 130 | effect/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." |
| 133 | effect/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." |
| 136 | effect/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." |
| 139 | effect/Cause#isTimeoutException: |
| 140 | replacement: "Cause.isTimeoutError" |
| 141 | note: "Rename the guard along with TimeoutError." |
| 142 | effect/Cause#isUnknownException: |
| 143 | replacement: "Cause.isUnknownError" |
| 144 | note: "Rename the guard along with UnknownError." |
| 145 | effect/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." |
| 148 | effect/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." |
| 151 | effect/Cause#NoSuchElementException: |
| 152 | replacement: "Cause.NoSuchElementError" |
| 153 | note: "Rename the class/type and update the discriminant from NoSuchElementException to NoSuchElementError." |
| 154 | effect/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." |
| 157 | effect/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." |
| 160 | effect/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." |
| 163 | effect/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." |
| 166 | effect/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." |
| 169 | effect/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." |
| 172 | effect/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." |
| 175 | effect/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." |
| 178 | effect/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." |
| 181 | effect/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." |
| 184 | effect/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." |
| 187 | effect/Cause#size: |
| 188 | replacement: "self.reasons.length" |
| 189 | note: "The v3 node count becomes the number of flat reasons in v4." |
| 190 | effect/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." |
| 193 | effect/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." |
| 196 | effect/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." |
| 199 | effect/Cause#TimeoutException: |
| 200 | replacement: "Cause.TimeoutError" |
| 201 | note: "Rename the class/type and update the discriminant from TimeoutException to TimeoutError." |
| 202 | effect/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." |
| 205 | effect/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." |
| 208 | effect/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." |
| 211 | effect/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." |