@typed/fx 1.8.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/Fx.d.ts +1 -1
  2. package/dist/Fx.d.ts.map +1 -1
  3. package/dist/Fx.js +2 -2
  4. package/dist/Fx.js.map +1 -1
  5. package/dist/RefSubject.d.ts +2 -2
  6. package/dist/RefSubject.d.ts.map +1 -1
  7. package/dist/RefSubject.js +132 -52
  8. package/dist/RefSubject.js.map +1 -1
  9. package/dist/cjs/Fx.d.ts +1 -1
  10. package/dist/cjs/Fx.d.ts.map +1 -1
  11. package/dist/cjs/Fx.js +2 -2
  12. package/dist/cjs/Fx.js.map +1 -1
  13. package/dist/cjs/RefSubject.d.ts +2 -2
  14. package/dist/cjs/RefSubject.d.ts.map +1 -1
  15. package/dist/cjs/RefSubject.js +131 -50
  16. package/dist/cjs/RefSubject.js.map +1 -1
  17. package/dist/cjs/data-first.d.ts +1 -0
  18. package/dist/cjs/data-first.d.ts.map +1 -1
  19. package/dist/cjs/data-first.js +1 -0
  20. package/dist/cjs/data-first.js.map +1 -1
  21. package/dist/cjs/hold.d.ts +1 -1
  22. package/dist/cjs/hold.d.ts.map +1 -1
  23. package/dist/cjs/hold.js +1 -1
  24. package/dist/cjs/hold.js.map +1 -1
  25. package/dist/cjs/index.d.ts +8 -0
  26. package/dist/cjs/index.d.ts.map +1 -1
  27. package/dist/cjs/index.js +106 -104
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/multicast.d.ts +1 -1
  30. package/dist/cjs/multicast.d.ts.map +1 -1
  31. package/dist/cjs/multicast.js +1 -1
  32. package/dist/cjs/multicast.js.map +1 -1
  33. package/dist/cjs/snapshotEffect.d.ts +5 -0
  34. package/dist/cjs/snapshotEffect.d.ts.map +1 -0
  35. package/dist/cjs/snapshotEffect.js +23 -0
  36. package/dist/cjs/snapshotEffect.js.map +1 -0
  37. package/dist/data-first.d.ts +1 -0
  38. package/dist/data-first.d.ts.map +1 -1
  39. package/dist/data-first.js +1 -0
  40. package/dist/data-first.js.map +1 -1
  41. package/dist/hold.d.ts +1 -1
  42. package/dist/hold.d.ts.map +1 -1
  43. package/dist/hold.js +1 -1
  44. package/dist/hold.js.map +1 -1
  45. package/dist/index.d.ts +8 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +104 -102
  48. package/dist/index.js.map +1 -1
  49. package/dist/multicast.d.ts +1 -1
  50. package/dist/multicast.d.ts.map +1 -1
  51. package/dist/multicast.js +1 -1
  52. package/dist/multicast.js.map +1 -1
  53. package/dist/snapshotEffect.d.ts +5 -0
  54. package/dist/snapshotEffect.d.ts.map +1 -0
  55. package/dist/snapshotEffect.js +18 -0
  56. package/dist/snapshotEffect.js.map +1 -0
  57. package/dist/tsconfig.cjs.build.tsbuildinfo +1 -1
  58. package/package.json +5 -5
  59. package/src/Fx.ts +3 -3
  60. package/src/RefSubject.test.ts +3 -3
  61. package/src/RefSubject.ts +203 -71
  62. package/src/data-first.ts +1 -0
  63. package/src/hold.ts +1 -1
  64. package/src/index.ts +150 -102
  65. package/src/multicast.ts +1 -1
  66. package/src/snapshotEffect.ts +45 -0
  67. package/tsconfig.build.tsbuildinfo +1 -1
package/src/index.ts CHANGED
@@ -18,7 +18,7 @@ export const at: {
18
18
  2,
19
19
  (trace) =>
20
20
  <A>(value: A, delay: Duration): Fx<never, never, A> =>
21
- internal.at(value, delay).traced(trace),
21
+ internal.at(value, delay).addTrace(trace),
22
22
  )
23
23
 
24
24
  export const catchAllCause: {
@@ -33,7 +33,7 @@ export const catchAllCause: {
33
33
  fx: Fx<R, E, B>,
34
34
  f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>,
35
35
  ): Fx<R | R2, E2, B> =>
36
- internal.catchAllCause(fx, f).traced(trace),
36
+ internal.catchAllCause(fx, f).addTrace(trace),
37
37
  )
38
38
 
39
39
  export const catchAllCauseEffect: {
@@ -52,7 +52,7 @@ export const catchAllCauseEffect: {
52
52
  fx: Fx<R, E, B>,
53
53
  f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
54
54
  ): Fx<R | R2, E2, B> =>
55
- internal.catchAllCauseEffect(fx, f).traced(trace),
55
+ internal.catchAllCauseEffect(fx, f).addTrace(trace),
56
56
  )
57
57
 
58
58
  export const catchAll: {
@@ -63,7 +63,7 @@ export const catchAll: {
63
63
  2,
64
64
  (trace) =>
65
65
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>): Fx<R | R2, E2, A | B> =>
66
- internal.catchAll(fx, f).traced(trace),
66
+ internal.catchAll(fx, f).addTrace(trace),
67
67
  )
68
68
 
69
69
  export const catchAllEffect: {
@@ -83,7 +83,7 @@ export const catchAllEffect: {
83
83
  fx: Fx<R, E, A>,
84
84
  f: (e: E) => Effect.Effect<R2, E2, B>,
85
85
  ): Fx<R | R2, E2, A | B> =>
86
- internal.catchAllEffect(fx, f).traced(trace),
86
+ internal.catchAllEffect(fx, f).addTrace(trace),
87
87
  )
88
88
 
89
89
  export const combineAll: <FX extends readonly internal.Fx<any, any, any>[]>(
@@ -95,7 +95,7 @@ export const combineAll: <FX extends readonly internal.Fx<any, any, any>[]>(
95
95
  > = methodWithTrace(
96
96
  (trace) =>
97
97
  (...fx) =>
98
- internal.combineAll(...fx).traced(trace),
98
+ internal.combineAll(...fx).addTrace(trace),
99
99
  )
100
100
 
101
101
  export const combine: {
@@ -104,7 +104,7 @@ export const combine: {
104
104
  ) => Fx<R | R2, E | E2, readonly [A, B]>
105
105
 
106
106
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, other: Fx<R2, E2, B>): Fx<R | R2, E | E2, readonly [A, B]>
107
- } = dualWithTrace(2, (trace) => (fx, other) => internal.combine(fx, other).traced(trace))
107
+ } = dualWithTrace(2, (trace) => (fx, other) => internal.combine(fx, other).addTrace(trace))
108
108
 
109
109
  export const continueWith: {
110
110
  <R2, E2, B>(f: () => Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>
@@ -114,7 +114,7 @@ export const continueWith: {
114
114
  2,
115
115
  (trace) =>
116
116
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: () => Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B> =>
117
- internal.continueWith(fx, f).traced(trace),
117
+ internal.continueWith(fx, f).addTrace(trace),
118
118
  )
119
119
 
120
120
  export const continueWithEffect: {
@@ -134,21 +134,21 @@ export const continueWithEffect: {
134
134
  fx: Fx<R, E, A>,
135
135
  f: () => Effect.Effect<R2, E2, B>,
136
136
  ): Fx<R | R2, E | E2, A | B> =>
137
- internal.continueWithEffect(fx, f).traced(trace),
137
+ internal.continueWithEffect(fx, f).addTrace(trace),
138
138
  )
139
139
 
140
140
  export const debounce: {
141
141
  (duration: Duration): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
142
142
  <R, E, A>(fx: Fx<R, E, A>, duration: Duration): Fx<R, E, A>
143
- } = dualWithTrace(2, (trace) => (fx, duration) => internal.debounce(fx, duration).traced(trace))
143
+ } = dualWithTrace(2, (trace) => (fx, duration) => internal.debounce(fx, duration).addTrace(trace))
144
144
 
145
145
  export const delay: {
146
146
  (duration: Duration): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
147
147
  <R, E, A>(fx: Fx<R, E, A>, duration: Duration): Fx<R, E, A>
148
- } = dualWithTrace(2, (trace) => (fx, duration) => internal.delay(fx, duration).traced(trace))
148
+ } = dualWithTrace(2, (trace) => (fx, duration) => internal.delay(fx, duration).addTrace(trace))
149
149
 
150
150
  export const empty: <E = never, A = never>(_: void) => Fx<never, E, A> = methodWithTrace(
151
- (trace) => () => internal.empty().traced(trace),
151
+ (trace) => () => internal.empty().addTrace(trace),
152
152
  )
153
153
 
154
154
  export const exhaustMap: {
@@ -159,7 +159,7 @@ export const exhaustMap: {
159
159
  2,
160
160
  (trace) =>
161
161
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>) =>
162
- internal.exhaustMap(fx, f).traced(trace),
162
+ internal.exhaustMap(fx, f).addTrace(trace),
163
163
  )
164
164
 
165
165
  export const exhaustMapEffect: {
@@ -176,14 +176,14 @@ export const exhaustMapEffect: {
176
176
  2,
177
177
  (trace) =>
178
178
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>) =>
179
- internal.exhaustMapEffect(fx, f).traced(trace),
179
+ internal.exhaustMapEffect(fx, f).addTrace(trace),
180
180
  )
181
181
 
182
182
  export const exhaust: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A> =
183
183
  methodWithTrace(
184
184
  (trace) =>
185
185
  <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) =>
186
- internal.exhaust<R, E, R2, E2, A>(fx).traced(trace),
186
+ internal.exhaust<R, E, R2, E2, A>(fx).addTrace(trace),
187
187
  )
188
188
 
189
189
  export const exhaustEffect: <R, E, R2, E2, A>(
@@ -191,7 +191,7 @@ export const exhaustEffect: <R, E, R2, E2, A>(
191
191
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
192
192
  (trace) =>
193
193
  <R, E, R2, E2, A>(fx: Fx<R, E, Effect.Effect<R2, E2, A>>) =>
194
- internal.exhaustEffect<R, E, R2, E2, A>(fx).traced(trace),
194
+ internal.exhaustEffect<R, E, R2, E2, A>(fx).addTrace(trace),
195
195
  )
196
196
 
197
197
  export const exhaustMapLatest: {
@@ -202,7 +202,7 @@ export const exhaustMapLatest: {
202
202
  2,
203
203
  (trace) =>
204
204
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>) =>
205
- internal.exhaustMapLatest(fx, f).traced(trace),
205
+ internal.exhaustMapLatest(fx, f).addTrace(trace),
206
206
  )
207
207
 
208
208
  export const exhaustMapLatestEffect: {
@@ -219,7 +219,7 @@ export const exhaustMapLatestEffect: {
219
219
  2,
220
220
  (trace) =>
221
221
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Effect.Effect<R2, E2, B>) =>
222
- internal.exhaustMapLatestEffect(fx, f).traced(trace),
222
+ internal.exhaustMapLatestEffect(fx, f).addTrace(trace),
223
223
  )
224
224
 
225
225
  export const exhaustLatest: <R, E, R2, E2, A>(
@@ -227,7 +227,7 @@ export const exhaustLatest: <R, E, R2, E2, A>(
227
227
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
228
228
  (trace) =>
229
229
  <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) =>
230
- internal.exhaustLatest<R, E, R2, E2, A>(fx).traced(trace),
230
+ internal.exhaustLatest<R, E, R2, E2, A>(fx).addTrace(trace),
231
231
  )
232
232
 
233
233
  export const exhaustLatestEffect: <R, E, R2, E2, A>(
@@ -235,7 +235,7 @@ export const exhaustLatestEffect: <R, E, R2, E2, A>(
235
235
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
236
236
  (trace) =>
237
237
  <R, E, R2, E2, A>(fx: Fx<R, E, Effect.Effect<R2, E2, A>>) =>
238
- internal.exhaustLatestEffect<R, E, R2, E2, A>(fx).traced(trace),
238
+ internal.exhaustLatestEffect<R, E, R2, E2, A>(fx).addTrace(trace),
239
239
  )
240
240
 
241
241
  export const exhaustMapCause: {
@@ -252,7 +252,7 @@ export const exhaustMapCause: {
252
252
  2,
253
253
  (trace) =>
254
254
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: Cause.Cause<E>) => Fx<R2, E2, B>) =>
255
- internal.exhaustMapCause(fx, f).traced(trace),
255
+ internal.exhaustMapCause(fx, f).addTrace(trace),
256
256
  )
257
257
 
258
258
  export const exhaustMapCauseEffect: {
@@ -269,7 +269,7 @@ export const exhaustMapCauseEffect: {
269
269
  2,
270
270
  (trace) =>
271
271
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: Cause.Cause<E>) => Effect.Effect<R2, E2, B>) =>
272
- internal.exhaustMapCauseEffect(fx, f).traced(trace),
272
+ internal.exhaustMapCauseEffect(fx, f).addTrace(trace),
273
273
  )
274
274
 
275
275
  export const exhaustMapError: {
@@ -280,7 +280,7 @@ export const exhaustMapError: {
280
280
  2,
281
281
  (trace) =>
282
282
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>) =>
283
- internal.exhaustMapError(fx, f).traced(trace),
283
+ internal.exhaustMapError(fx, f).addTrace(trace),
284
284
  )
285
285
 
286
286
  export const exhaustMapErrorEffect: {
@@ -297,7 +297,7 @@ export const exhaustMapErrorEffect: {
297
297
  2,
298
298
  (trace) =>
299
299
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, B>) =>
300
- internal.exhaustMapErrorEffect(fx, f).traced(trace),
300
+ internal.exhaustMapErrorEffect(fx, f).addTrace(trace),
301
301
  )
302
302
 
303
303
  export const exhaustMapLatestCause: {
@@ -314,7 +314,7 @@ export const exhaustMapLatestCause: {
314
314
  2,
315
315
  (trace) =>
316
316
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: Cause.Cause<E>) => Fx<R2, E2, B>) =>
317
- internal.exhaustMapLatestCause(fx, f).traced(trace),
317
+ internal.exhaustMapLatestCause(fx, f).addTrace(trace),
318
318
  )
319
319
 
320
320
  export const exhaustMapLatestCauseEffect: {
@@ -331,7 +331,7 @@ export const exhaustMapLatestCauseEffect: {
331
331
  2,
332
332
  (trace) =>
333
333
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: Cause.Cause<E>) => Effect.Effect<R2, E2, B>) =>
334
- internal.exhaustMapLatestCauseEffect(fx, f).traced(trace),
334
+ internal.exhaustMapLatestCauseEffect(fx, f).addTrace(trace),
335
335
  )
336
336
 
337
337
  export const exhaustMapLatestError: {
@@ -342,7 +342,7 @@ export const exhaustMapLatestError: {
342
342
  2,
343
343
  (trace) =>
344
344
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Fx<R2, E2, B>) =>
345
- internal.exhaustMapLatestError(fx, f).traced(trace),
345
+ internal.exhaustMapLatestError(fx, f).addTrace(trace),
346
346
  )
347
347
 
348
348
  export const exhaustMapLatestErrorEffect: {
@@ -359,25 +359,25 @@ export const exhaustMapLatestErrorEffect: {
359
359
  2,
360
360
  (trace) =>
361
361
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (e: E) => Effect.Effect<R2, E2, B>) =>
362
- internal.exhaustMapLatestErrorEffect(fx, f).traced(trace),
362
+ internal.exhaustMapLatestErrorEffect(fx, f).addTrace(trace),
363
363
  )
364
364
 
365
365
  export const failCause: <E>(cause: Cause.Cause<E>) => Fx<never, E, never> = methodWithTrace(
366
366
  (trace) =>
367
367
  <E>(cause: Cause.Cause<E>): Fx<never, E, never> =>
368
- internal.failCause(cause).traced(trace),
368
+ internal.failCause(cause).addTrace(trace),
369
369
  )
370
370
 
371
371
  export const fail: <E>(e: E) => Fx<never, E, never> = methodWithTrace(
372
372
  (trace) =>
373
373
  <E>(e: E): Fx<never, E, never> =>
374
- internal.fail(e).traced(trace),
374
+ internal.fail(e).addTrace(trace),
375
375
  )
376
376
 
377
377
  export const interrupt: (id: FiberId) => Fx<never, never, never> = methodWithTrace(
378
378
  (trace) =>
379
379
  (id: FiberId): Fx<never, never, never> =>
380
- internal.interrupt(id).traced(trace),
380
+ internal.interrupt(id).addTrace(trace),
381
381
  )
382
382
 
383
383
  export const filter: {
@@ -390,7 +390,7 @@ export const filter: {
390
390
  2,
391
391
  (trace) =>
392
392
  <R, E, A, B extends A>(fx: Fx<R, E, A>, predicate: Predicate<A>): Fx<R, E, A | B> =>
393
- internal.filter(fx, predicate).traced(trace),
393
+ internal.filter(fx, predicate).addTrace(trace),
394
394
  )
395
395
 
396
396
  export const filterMap: {
@@ -400,13 +400,13 @@ export const filterMap: {
400
400
  2,
401
401
  (trace) =>
402
402
  <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => Option.Option<B>): Fx<R, E, B> =>
403
- internal.filterMap(fx, f).traced(trace),
403
+ internal.filterMap(fx, f).addTrace(trace),
404
404
  )
405
405
 
406
406
  export const compact: <R, E, A>(fx: Fx<R, E, Option.Option<A>>) => Fx<R, E, A> = methodWithTrace(
407
407
  (trace) =>
408
408
  <R, E, A>(fx: Fx<R, E, Option.Option<A>>): Fx<R, E, A> =>
409
- internal.compact(fx).traced(trace),
409
+ internal.compact(fx).addTrace(trace),
410
410
  )
411
411
 
412
412
  export const flatMap: {
@@ -416,7 +416,7 @@ export const flatMap: {
416
416
  2,
417
417
  (trace) =>
418
418
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>): Fx<R | R2, E | E2, B> =>
419
- internal.flatMap(fx, f).traced(trace),
419
+ internal.flatMap(fx, f).addTrace(trace),
420
420
  )
421
421
 
422
422
  export const flatMapEffect: {
@@ -435,14 +435,14 @@ export const flatMapEffect: {
435
435
  fx: Fx<R, E, A>,
436
436
  f: (a: A) => Effect.Effect<R2, E2, B>,
437
437
  ): Fx<R | R2, E | E2, B> =>
438
- internal.flatMapEffect(fx, f).traced(trace),
438
+ internal.flatMapEffect(fx, f).addTrace(trace),
439
439
  )
440
440
 
441
441
  export const flatten: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A> =
442
442
  methodWithTrace(
443
443
  (trace) =>
444
444
  <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>): Fx<R | R2, E | E2, A> =>
445
- internal.flatten<R, E, R2, E2, A>(fx).traced(trace),
445
+ internal.flatten<R, E, R2, E2, A>(fx).addTrace(trace),
446
446
  )
447
447
 
448
448
  export const flattenEffect: <R, E, R2, E2, A>(
@@ -450,19 +450,19 @@ export const flattenEffect: <R, E, R2, E2, A>(
450
450
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
451
451
  (trace) =>
452
452
  <R, E, R2, E2, A>(fx: Fx<R, E, Effect.Effect<R2, E2, A>>): Fx<R | R2, E | E2, A> =>
453
- internal.flattenEffect(fx).traced(trace),
453
+ internal.flattenEffect(fx).addTrace(trace),
454
454
  )
455
455
 
456
456
  export const fromArray: <A>(as: ReadonlyArray<A>) => Fx<never, never, A> = methodWithTrace(
457
457
  (trace) =>
458
458
  <A>(as: ReadonlyArray<A>): Fx<never, never, A> =>
459
- internal.fromArray(as).traced(trace),
459
+ internal.fromArray(as).addTrace(trace),
460
460
  )
461
461
 
462
462
  export const fromEffect: <R, E, A>(effect: Effect.Effect<R, E, A>) => Fx<R, E, A> = methodWithTrace(
463
463
  (trace) =>
464
464
  <R, E, A>(effect: Effect.Effect<R, E, A>): Fx<R, E, A> =>
465
- internal.fromEffect(effect).traced(trace),
465
+ internal.fromEffect(effect).addTrace(trace),
466
466
  )
467
467
 
468
468
  export interface Emitter<E, A> extends internal.Emitter<E, A> {}
@@ -470,13 +470,13 @@ export interface Emitter<E, A> extends internal.Emitter<E, A> {}
470
470
  export const fromEmitter: <E, A, R, E2>(
471
471
  f: (emitter: internal.Emitter<E, A>) => Effect.Effect<R | Scope.Scope, E2, void>,
472
472
  ) => internal.Fx<Exclude<R, Scope.Scope>, E | E2, A> = methodWithTrace(
473
- (trace) => (f) => internal.fromEmitter(f).traced(trace),
473
+ (trace) => (f) => internal.fromEmitter(f).addTrace(trace),
474
474
  )
475
475
 
476
476
  export const fromIterable: <A>(as: Iterable<A>) => Fx<never, never, A> = methodWithTrace(
477
477
  (trace) =>
478
478
  <A>(as: Iterable<A>): Fx<never, never, A> =>
479
- internal.fromIterable(as).traced(trace),
479
+ internal.fromIterable(as).addTrace(trace),
480
480
  )
481
481
 
482
482
  export const fromFxEffect: <R, E, R2, E2, A>(
@@ -484,7 +484,7 @@ export const fromFxEffect: <R, E, R2, E2, A>(
484
484
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
485
485
  (trace) =>
486
486
  <R, E, R2, E2, A>(effect: Effect.Effect<R, E, Fx<R2, E2, A>>): Fx<R | R2, E | E2, A> =>
487
- internal.fromFxEffect(effect).traced(trace),
487
+ internal.fromFxEffect(effect).addTrace(trace),
488
488
  )
489
489
 
490
490
  export type EffectGenResources<T> = internal.EffectGenResources<T>
@@ -496,13 +496,13 @@ export type EffectGenOutput<T> = internal.EffectGenOutput<T>
496
496
  export const gen: <Y extends Effect.EffectGen<any, any, any>, R, E, A>(
497
497
  f: (adaper: Effect.Adapter) => Generator<Y, Fx<R, E, A>, unknown>,
498
498
  ) => Fx<R | internal.EffectGenResources<Y>, E | internal.EffectGenErrors<Y>, A> = methodWithTrace(
499
- (trace) => (f) => internal.gen(f).traced(trace),
499
+ (trace) => (f) => internal.gen(f).addTrace(trace),
500
500
  )
501
501
 
502
502
  export const hold: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A> = methodWithTrace(
503
503
  (trace) =>
504
504
  <R, E, A>(fx: Fx<R, E, A>): Fx<R, E, A> =>
505
- internal.hold(fx).traced(trace),
505
+ internal.hold(fx).addTrace(trace),
506
506
  )
507
507
 
508
508
  export const map: {
@@ -512,7 +512,7 @@ export const map: {
512
512
  2,
513
513
  (trace) =>
514
514
  <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => B): Fx<R, E, B> =>
515
- internal.map(fx, f).traced(trace),
515
+ internal.map(fx, f).addTrace(trace),
516
516
  )
517
517
 
518
518
  export const as: {
@@ -522,7 +522,7 @@ export const as: {
522
522
  2,
523
523
  (trace) =>
524
524
  <R, E, A, B>(fx: Fx<R, E, A>, value: B): Fx<R, E, B> =>
525
- internal.as(fx, value).traced(trace),
525
+ internal.as(fx, value).addTrace(trace),
526
526
  )
527
527
 
528
528
  export const mergeAll: <FXS extends ReadonlyArray<Fx<any, any, any>>>(
@@ -534,22 +534,22 @@ export const mergeAll: <FXS extends ReadonlyArray<Fx<any, any, any>>>(
534
534
  > = methodWithTrace(
535
535
  (trace) =>
536
536
  (...fxs) =>
537
- internal.mergeAll(...fxs).traced(trace),
537
+ internal.mergeAll(...fxs).addTrace(trace),
538
538
  )
539
539
 
540
540
  export const merge: {
541
541
  <R2, E2, B>(other: Fx<R2, E2, B>): <R, E, A>(fx: Fx<R, E, A>) => Fx<R | R2, E | E2, A | B>
542
542
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, other: Fx<R2, E2, B>): Fx<R | R2, E | E2, A | B>
543
- } = dualWithTrace(2, (trace) => (fx, other) => internal.merge(fx, other).traced(trace))
543
+ } = dualWithTrace(2, (trace) => (fx, other) => internal.merge(fx, other).addTrace(trace))
544
544
 
545
545
  export const multicast: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A> = methodWithTrace(
546
546
  (trace) =>
547
547
  <R, E, A>(fx: Fx<R, E, A>): Fx<R, E, A> =>
548
- internal.multicast(fx).traced(trace),
548
+ internal.multicast(fx).addTrace(trace),
549
549
  )
550
550
 
551
551
  export const never: <E = never, A = never>(_: void) => Fx<never, E, A> = methodWithTrace(
552
- (trace) => () => internal.never().traced(trace),
552
+ (trace) => () => internal.never().addTrace(trace),
553
553
  )
554
554
 
555
555
  export const observe: {
@@ -576,75 +576,78 @@ export const onInterrupt: {
576
576
  fx: Fx<R, E, A>,
577
577
  f: (interruptors: HashSet<FiberId>) => Effect.Effect<R2, E2, B>,
578
578
  ): Fx<R | R2, E | E2, A>
579
- } = dualWithTrace(2, (trace) => (fx, f) => internal.onInterrupt(fx, f).traced(trace))
579
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.onInterrupt(fx, f).addTrace(trace))
580
580
 
581
581
  export const promise: <A>(f: () => Promise<A>) => Fx<never, never, A> = methodWithTrace(
582
- (trace) => (f) => internal.promise(f).traced(trace),
582
+ (trace) => (f) => internal.promise(f).addTrace(trace),
583
583
  )
584
584
 
585
585
  export const promiseInterrupt: <A>(f: (signal: AbortSignal) => Promise<A>) => Fx<never, never, A> =
586
- methodWithTrace((trace) => (f) => internal.promiseInterrupt(f).traced(trace))
586
+ methodWithTrace((trace) => (f) => internal.promiseInterrupt(f).addTrace(trace))
587
587
 
588
588
  export const tryPromise: <A>(f: () => Promise<A>) => Fx<never, unknown, A> = methodWithTrace(
589
- (trace) => (f) => internal.tryPromise(f).traced(trace),
589
+ (trace) => (f) => internal.tryPromise(f).addTrace(trace),
590
590
  )
591
591
 
592
592
  export const tryPromiseInterrupt: <A>(
593
593
  f: (signal: AbortSignal) => Promise<A>,
594
594
  ) => Fx<never, unknown, A> = methodWithTrace(
595
- (trace) => (f) => internal.tryPromiseInterrupt(f).traced(trace),
595
+ (trace) => (f) => internal.tryPromiseInterrupt(f).addTrace(trace),
596
596
  )
597
597
 
598
598
  export const tryCatchPromise: <A, E>(
599
599
  f: () => Promise<A>,
600
600
  g: (error: unknown) => E,
601
601
  ) => Fx<never, E, A> = methodWithTrace(
602
- (trace) => (f, g) => internal.tryCatchPromise(f, g).traced(trace),
602
+ (trace) => (f, g) => internal.tryCatchPromise(f, g).addTrace(trace),
603
603
  )
604
604
 
605
605
  export const tryCatchPromiseInterrupt: <A, E>(
606
606
  f: (signal: AbortSignal) => Promise<A>,
607
607
  g: (error: unknown) => E,
608
608
  ) => Fx<never, E, A> = methodWithTrace(
609
- (trace) => (f, g) => internal.tryCatchPromiseInterrupt(f, g).traced(trace),
609
+ (trace) => (f, g) => internal.tryCatchPromiseInterrupt(f, g).addTrace(trace),
610
610
  )
611
611
 
612
612
  export const promiseFx: <R, E, A>(f: () => Promise<Fx<R, E, A>>) => Fx<R, E, A> = methodWithTrace(
613
- (trace) => (f) => internal.promiseFx(f).traced(trace),
613
+ (trace) => (f) => internal.promiseFx(f).addTrace(trace),
614
614
  )
615
615
 
616
616
  export const promiseInterrupFx: <R, E, A>(
617
617
  f: (signal: AbortSignal) => Promise<Fx<R, E, A>>,
618
- ) => Fx<R, E, A> = methodWithTrace((trace) => (f) => internal.promiseInterruptFx(f).traced(trace))
618
+ ) => Fx<R, E, A> = methodWithTrace((trace) => (f) => internal.promiseInterruptFx(f).addTrace(trace))
619
619
 
620
620
  export const tryPromiseFx: <R, E, A>(f: () => Promise<Fx<R, E, A>>) => Fx<R, unknown, A> =
621
- methodWithTrace((trace) => (f) => internal.tryPromiseFx(f).traced(trace))
621
+ methodWithTrace((trace) => (f) => internal.tryPromiseFx(f).addTrace(trace))
622
622
 
623
623
  export const tryPromiseInterruptFx: <R, E, A>(
624
624
  f: (signal: AbortSignal) => Promise<Fx<R, E, A>>,
625
625
  ) => Fx<R, unknown, A> = methodWithTrace(
626
- (trace) => (f) => internal.tryPromiseInterruptFx(f).traced(trace),
626
+ (trace) => (f) => internal.tryPromiseInterruptFx(f).addTrace(trace),
627
627
  )
628
628
 
629
629
  export const tryCatchPromiseFx: <R, E, A, E2>(
630
630
  f: () => Promise<Fx<R, E, A>>,
631
631
  g: (error: unknown) => E2,
632
632
  ) => Fx<R, E | E2, A> = methodWithTrace(
633
- (trace) => (f, g) => internal.tryCatchPromiseFx(f, g).traced(trace),
633
+ (trace) => (f, g) => internal.tryCatchPromiseFx(f, g).addTrace(trace),
634
634
  )
635
635
 
636
636
  export const tryCatchPromiseInterruptFx: <R, E, A, E2>(
637
637
  f: (signal: AbortSignal) => Promise<Fx<R, E, A>>,
638
638
  g: (error: unknown) => E2,
639
639
  ) => Fx<R, E | E2, A> = methodWithTrace(
640
- (trace) => (f, g) => internal.tryCatchPromiseInterruptFx(f, g).traced(trace),
640
+ (trace) => (f, g) => internal.tryCatchPromiseInterruptFx(f, g).addTrace(trace),
641
641
  )
642
642
 
643
643
  export const provideContext: {
644
644
  <R>(context: Context.Context<R>): <E, A>(fx: Fx<R, E, A>) => Fx<never, E, A>
645
645
 
646
646
  <R, E, A>(fx: Fx<R, E, A>, context: Context.Context<R>): Fx<never, E, A>
647
- } = dualWithTrace(2, (trace) => (fx, context) => internal.provideContext(fx, context).traced(trace))
647
+ } = dualWithTrace(
648
+ 2,
649
+ (trace) => (fx, context) => internal.provideContext(fx, context).addTrace(trace),
650
+ )
648
651
 
649
652
  export const provideSomeContext: {
650
653
  <S>(context: Context.Context<S>): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, S>, E, A>
@@ -652,14 +655,14 @@ export const provideSomeContext: {
652
655
  <R, E, A, S>(fx: Fx<R, E, A>, context: Context.Context<S>): Fx<Exclude<R, S>, E, A>
653
656
  } = dualWithTrace(
654
657
  2,
655
- (trace) => (fx, context) => internal.provideSomeContext(fx, context).traced(trace),
658
+ (trace) => (fx, context) => internal.provideSomeContext(fx, context).addTrace(trace),
656
659
  )
657
660
 
658
661
  export const provideLayer: {
659
662
  <R2, E2, R>(layer: Layer.Layer<R2, E2, R>): <E, A>(fx: Fx<R, E, A>) => Fx<R2, E | E2, A>
660
663
 
661
664
  <R, E, A, R2, E2>(fx: Fx<R, E, A>, layer: Layer.Layer<R2, E2, R>): Fx<R2, E | E2, A>
662
- } = dualWithTrace(2, (trace) => (fx, layer) => internal.provideLayer(fx, layer).traced(trace))
665
+ } = dualWithTrace(2, (trace) => (fx, layer) => internal.provideLayer(fx, layer).addTrace(trace))
663
666
 
664
667
  export const provideSomeLayer: {
665
668
  <R2, E2, S>(layer: Layer.Layer<R2, E2, S>): <R, E, A>(
@@ -671,7 +674,7 @@ export const provideSomeLayer: {
671
674
  E | E2,
672
675
  A
673
676
  >
674
- } = dualWithTrace(2, (trace) => (fx, layer) => internal.provideSomeLayer(fx, layer).traced(trace))
677
+ } = dualWithTrace(2, (trace) => (fx, layer) => internal.provideSomeLayer(fx, layer).addTrace(trace))
675
678
 
676
679
  export const provideService: {
677
680
  <I, S>(tag: Context.Tag<I, S>, service: S): <R, E, A>(fx: Fx<R, E, A>) => Fx<Exclude<R, I>, E, A>
@@ -679,7 +682,7 @@ export const provideService: {
679
682
  <R, E, A, I, S>(fx: Fx<R, E, A>, tag: Context.Tag<I, S>, service: S): Fx<Exclude<R, I>, E, A>
680
683
  } = dualWithTrace(
681
684
  3,
682
- (trace) => (fx, tag, service) => internal.provideService(fx, tag, service).traced(trace),
685
+ (trace) => (fx, tag, service) => internal.provideService(fx, tag, service).addTrace(trace),
683
686
  )
684
687
 
685
688
  export const provideServiceEffect: {
@@ -694,7 +697,7 @@ export const provideServiceEffect: {
694
697
  ): Fx<Exclude<R, I> | R2, E | E2, A>
695
698
  } = dualWithTrace(
696
699
  3,
697
- (trace) => (fx, tag, service) => internal.provideServiceEffect(fx, tag, service).traced(trace),
700
+ (trace) => (fx, tag, service) => internal.provideServiceEffect(fx, tag, service).addTrace(trace),
698
701
  )
699
702
 
700
703
  export const provideServiceFx: {
@@ -709,7 +712,7 @@ export const provideServiceFx: {
709
712
  >
710
713
  } = dualWithTrace(
711
714
  3,
712
- (trace) => (fx, tag, service) => internal.provideServiceFx(fx, tag, service).traced(trace),
715
+ (trace) => (fx, tag, service) => internal.provideServiceFx(fx, tag, service).addTrace(trace),
713
716
  )
714
717
 
715
718
  export const reduce: {
@@ -721,48 +724,87 @@ export const reduce: {
721
724
  export const scan: {
722
725
  <B, A>(seed: B, f: (b: B, a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, B>
723
726
  <R, E, A, B>(fx: Fx<R, E, A>, seed: B, f: (b: B, a: A) => B): Fx<R, E, B>
724
- } = dualWithTrace(3, (trace) => (fx, seed, f) => internal.scan(fx, seed, f).traced(trace))
727
+ } = dualWithTrace(3, (trace) => (fx, seed, f) => internal.scan(fx, seed, f).addTrace(trace))
725
728
 
726
729
  export const skipRepeatsWith: {
727
730
  <A>(eq: Equivalence<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
728
731
  <R, E, A>(fx: Fx<R, E, A>, eq: Equivalence<A>): Fx<R, E, A>
729
- } = dualWithTrace(2, (trace) => (fx, eq) => internal.skipRepeatsWith(fx, eq).traced(trace))
732
+ } = dualWithTrace(2, (trace) => (fx, eq) => internal.skipRepeatsWith(fx, eq).addTrace(trace))
730
733
 
731
734
  export const skipRepeats: <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A> = methodWithTrace(
732
- (trace) => (fx) => internal.skipRepeats(fx).traced(trace),
735
+ (trace) => (fx) => internal.skipRepeats(fx).addTrace(trace),
733
736
  )
734
737
 
735
738
  export const skipWhile: {
736
739
  <A>(predicate: Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
737
740
  <R, E, A>(fx: Fx<R, E, A>, predicate: Predicate<A>): Fx<R, E, A>
738
- } = dualWithTrace(2, (trace) => (fx, predicate) => internal.skipWhile(fx, predicate).traced(trace))
741
+ } = dualWithTrace(
742
+ 2,
743
+ (trace) => (fx, predicate) => internal.skipWhile(fx, predicate).addTrace(trace),
744
+ )
739
745
 
740
746
  export const skipUntil: {
741
747
  <A>(predicate: Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
742
748
  <R, E, A>(fx: Fx<R, E, A>, predicate: Predicate<A>): Fx<R, E, A>
743
- } = dualWithTrace(2, (trace) => (fx, predicate) => internal.skipUntil(fx, predicate).traced(trace))
749
+ } = dualWithTrace(
750
+ 2,
751
+ (trace) => (fx, predicate) => internal.skipUntil(fx, predicate).addTrace(trace),
752
+ )
744
753
 
745
754
  export const slice: {
746
755
  (skip: number, take: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
747
756
  <R, E, A>(fx: Fx<R, E, A>, skip: number, take: number): Fx<R, E, A>
748
- } = dualWithTrace(3, (trace) => (fx, skip, take) => internal.slice(fx, skip, take).traced(trace))
757
+ } = dualWithTrace(3, (trace) => (fx, skip, take) => internal.slice(fx, skip, take).addTrace(trace))
749
758
 
750
759
  export const skip: {
751
760
  (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
752
761
  <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>
753
- } = dualWithTrace(2, (trace) => (fx, n) => internal.skip(fx, n).traced(trace))
762
+ } = dualWithTrace(2, (trace) => (fx, n) => internal.skip(fx, n).addTrace(trace))
754
763
 
755
764
  export const take: {
756
765
  (n: number): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
757
766
  <R, E, A>(fx: Fx<R, E, A>, n: number): Fx<R, E, A>
758
- } = dualWithTrace(2, (trace) => (fx, n) => internal.take(fx, n).traced(trace))
767
+ } = dualWithTrace(2, (trace) => (fx, n) => internal.take(fx, n).addTrace(trace))
768
+
769
+ export const snapshotEffect: {
770
+ <R2, E2, B, R3, E3, A, C>(sampled: Fx<R2, E2, B>, f: (a: A, b: B) => Effect.Effect<R3, E3, C>): <
771
+ R,
772
+ E,
773
+ >(
774
+ fx: Fx<R, E, A>,
775
+ ) => Fx<R | R2 | R3, E | E2 | E3, C>
776
+
777
+ <R, E, A, R2, E2, B, R3, E3, C>(
778
+ fx: Fx<R, E, A>,
779
+ sampled: Fx<R2, E2, B>,
780
+ f: (a: A, b: B) => Effect.Effect<R3, E3, C>,
781
+ ): Fx<R | R2 | R3, E | E2 | E3, C>
782
+ } = dualWithTrace(
783
+ 3,
784
+ (trace) => (fx, sampled, f) => internal.snapshotEffect(fx, sampled, f).addTrace(trace),
785
+ )
786
+
787
+ export const snapshot: {
788
+ <R2, E2, B, A, C>(sampled: Fx<R2, E2, B>, f: (a: A, b: B) => C): <R, E>(
789
+ fx: Fx<R, E, A>,
790
+ ) => Fx<R | R2, E | E2, C>
791
+
792
+ <R, E, A, R2, E2, B, C>(fx: Fx<R, E, A>, sampled: Fx<R2, E2, B>, f: (a: A, b: B) => C): Fx<
793
+ R | R2,
794
+ E | E2,
795
+ C
796
+ >
797
+ } = dualWithTrace(
798
+ 3,
799
+ (trace) => (fx, sampled, f) => internal.snapshot(fx, sampled, f).addTrace(trace),
800
+ )
759
801
 
760
802
  export const succeed: <A>(a: A) => Fx<never, never, A> = methodWithTrace(
761
- (trace) => (a) => internal.succeed(a).traced(trace),
803
+ (trace) => (a) => internal.succeed(a).addTrace(trace),
762
804
  )
763
805
 
764
806
  export const suspend: <R, E, A>(fx: () => Fx<R, E, A>) => Fx<R, E, A> = methodWithTrace(
765
- (trace) => (fx) => internal.suspend(fx).traced(trace),
807
+ (trace) => (fx) => internal.suspend(fx).addTrace(trace),
766
808
  )
767
809
 
768
810
  export const switchMap: {
@@ -772,7 +814,7 @@ export const switchMap: {
772
814
  2,
773
815
  (trace) =>
774
816
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>): Fx<R | R2, E | E2, B> =>
775
- internal.switchMap(fx, f).traced(trace),
817
+ internal.switchMap(fx, f).addTrace(trace),
776
818
  )
777
819
 
778
820
  export const switchMapEffect: {
@@ -791,14 +833,14 @@ export const switchMapEffect: {
791
833
  fx: Fx<R, E, A>,
792
834
  f: (a: A) => Effect.Effect<R2, E2, B>,
793
835
  ): Fx<R | R2, E | E2, B> =>
794
- internal.switchMapEffect(fx, f).traced(trace),
836
+ internal.switchMapEffect(fx, f).addTrace(trace),
795
837
  )
796
838
 
797
839
  export const switchLatest: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A> =
798
840
  methodWithTrace(
799
841
  (trace) =>
800
842
  <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>): Fx<R | R2, E | E2, A> =>
801
- internal.switchLatest<R, E, R2, E2, A>(fx).traced(trace),
843
+ internal.switchLatest<R, E, R2, E2, A>(fx).addTrace(trace),
802
844
  )
803
845
 
804
846
  export const switchLatestEffect: <R, E, R2, E2, A>(
@@ -806,7 +848,7 @@ export const switchLatestEffect: <R, E, R2, E2, A>(
806
848
  ) => Fx<R | R2, E | E2, A> = methodWithTrace(
807
849
  (trace) =>
808
850
  <R, E, R2, E2, A>(fx: Fx<R, E, Effect.Effect<R2, E2, A>>): Fx<R | R2, E | E2, A> =>
809
- internal.switchLatestEffect(fx).traced(trace),
851
+ internal.switchLatestEffect(fx).addTrace(trace),
810
852
  )
811
853
 
812
854
  export const switchMatchCause: {
@@ -828,7 +870,7 @@ export const switchMatchCause: {
828
870
  f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>,
829
871
  g: (a: A) => Fx<R3, E3, C>,
830
872
  ): Fx<R | R2 | R3, E2 | E3, B | C> =>
831
- internal.switchMatchCause(fx, f, g).traced(trace),
873
+ internal.switchMatchCause(fx, f, g).addTrace(trace),
832
874
  )
833
875
 
834
876
  export const switchMatchCauseEffect: {
@@ -850,7 +892,7 @@ export const switchMatchCauseEffect: {
850
892
  f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
851
893
  g: (a: A) => Effect.Effect<R3, E3, C>,
852
894
  ): Fx<R | R2 | R3, E2 | E3, B | C> =>
853
- internal.switchMatchCauseEffect(fx, f, g).traced(trace),
895
+ internal.switchMatchCauseEffect(fx, f, g).addTrace(trace),
854
896
  )
855
897
 
856
898
  export const switchMatch: {
@@ -871,7 +913,7 @@ export const switchMatch: {
871
913
  f: (error: E) => Fx<R2, E2, B>,
872
914
  g: (a: A) => Fx<R3, E3, C>,
873
915
  ): Fx<R | R2 | R3, E2 | E3, B | C> =>
874
- internal.switchMatch(fx, f, g).traced(trace),
916
+ internal.switchMatch(fx, f, g).addTrace(trace),
875
917
  )
876
918
 
877
919
  export const switchMatchEffect: {
@@ -885,7 +927,7 @@ export const switchMatchEffect: {
885
927
  f: (error: E) => Effect.Effect<R2, E2, B>,
886
928
  g: (a: A) => Effect.Effect<R3, E3, C>,
887
929
  ): Fx<R | R2 | R3, E2 | E3, B | C>
888
- } = dualWithTrace(3, (trace) => (fx, f, g) => internal.switchMatchEffect(fx, f, g).traced(trace))
930
+ } = dualWithTrace(3, (trace) => (fx, f, g) => internal.switchMatchEffect(fx, f, g).addTrace(trace))
889
931
 
890
932
  export const switchMapCause: {
891
933
  <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Fx<R2, E2, B>): <R, A>(
@@ -897,7 +939,7 @@ export const switchMapCause: {
897
939
  E2,
898
940
  B
899
941
  >
900
- } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapCause(fx, f).traced(trace))
942
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapCause(fx, f).addTrace(trace))
901
943
 
902
944
  export const switchMapCauseEffect: {
903
945
  <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>): <R, A>(
@@ -909,13 +951,13 @@ export const switchMapCauseEffect: {
909
951
  E2,
910
952
  B
911
953
  >
912
- } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapCauseEffect(fx, f).traced(trace))
954
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapCauseEffect(fx, f).addTrace(trace))
913
955
 
914
956
  export const switchMapError: {
915
957
  <E, R2, E2, B>(f: (error: E) => Fx<R2, E2, B>): <R, A>(fx: Fx<R, E, A>) => Fx<R | R2, E2, B>
916
958
 
917
959
  <R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (error: E) => Fx<R2, E2, B>): Fx<R | R2, E2, B>
918
- } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapError(fx, f).traced(trace))
960
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapError(fx, f).addTrace(trace))
919
961
 
920
962
  export const switchMapErrorEffect: {
921
963
  <E, R2, E2, B>(f: (error: E) => Effect.Effect<R2, E2, B>): <R, A>(
@@ -927,17 +969,23 @@ export const switchMapErrorEffect: {
927
969
  E2,
928
970
  B
929
971
  >
930
- } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapErrorEffect(fx, f).traced(trace))
972
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.switchMapErrorEffect(fx, f).addTrace(trace))
931
973
 
932
974
  export const takeWhile: {
933
975
  <A>(predicate: Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
934
976
  <R, E, A>(fx: Fx<R, E, A>, predicate: Predicate<A>): Fx<R, E, A>
935
- } = dualWithTrace(2, (trace) => (fx, predicate) => internal.takeWhile(fx, predicate).traced(trace))
977
+ } = dualWithTrace(
978
+ 2,
979
+ (trace) => (fx, predicate) => internal.takeWhile(fx, predicate).addTrace(trace),
980
+ )
936
981
 
937
982
  export const takeUntil: {
938
983
  <A>(predicate: Predicate<A>): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
939
984
  <R, E, A>(fx: Fx<R, E, A>, predicate: Predicate<A>): Fx<R, E, A>
940
- } = dualWithTrace(2, (trace) => (fx, predicate) => internal.takeUntil(fx, predicate).traced(trace))
985
+ } = dualWithTrace(
986
+ 2,
987
+ (trace) => (fx, predicate) => internal.takeUntil(fx, predicate).addTrace(trace),
988
+ )
941
989
 
942
990
  export const tap: {
943
991
  <A, R2, E2, B>(f: (a: A) => Effect.Effect<R2, E2, B>): <R, E>(
@@ -949,12 +997,12 @@ export const tap: {
949
997
  E | E2,
950
998
  A
951
999
  >
952
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tap(fx, f).traced(trace))
1000
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tap(fx, f).addTrace(trace))
953
1001
 
954
1002
  export const tapSync: {
955
1003
  <A, B>(f: (a: A) => B): <R, E>(fx: Fx<R, E, A>) => Fx<R, E, A>
956
1004
  <R, E, A, B>(fx: Fx<R, E, A>, f: (a: A) => B): Fx<R, E, A>
957
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tapSync(fx, f).traced(trace))
1005
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tapSync(fx, f).addTrace(trace))
958
1006
 
959
1007
  export const tapCause: {
960
1008
  <E, R2, E2, B>(f: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>): <R, A>(
@@ -966,12 +1014,12 @@ export const tapCause: {
966
1014
  E | E2,
967
1015
  A
968
1016
  >
969
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tapCause(fx, f).traced(trace))
1017
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tapCause(fx, f).addTrace(trace))
970
1018
 
971
1019
  export const tapCauseSync: {
972
1020
  <E, B>(f: (cause: Cause.Cause<E>) => B): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
973
1021
  <R, E, A, B>(fx: Fx<R, E, A>, f: (cause: Cause.Cause<E>) => B): Fx<R, E, A>
974
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tapCauseSync(fx, f).traced(trace))
1022
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tapCauseSync(fx, f).addTrace(trace))
975
1023
 
976
1024
  export const tapError: {
977
1025
  <E, R2, E2, B>(f: (error: E) => Effect.Effect<R2, E2, B>): <R, A>(
@@ -983,17 +1031,17 @@ export const tapError: {
983
1031
  E | E2,
984
1032
  A
985
1033
  >
986
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tapError(fx, f).traced(trace))
1034
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tapError(fx, f).addTrace(trace))
987
1035
 
988
1036
  export const tapErrorSync: {
989
1037
  <E, B>(f: (error: E) => B): <R, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
990
1038
  <R, E, A, B>(fx: Fx<R, E, A>, f: (error: E) => B): Fx<R, E, A>
991
- } = dualWithTrace(2, (trace) => (fx, f) => internal.tapErrorSync(fx, f).traced(trace))
1039
+ } = dualWithTrace(2, (trace) => (fx, f) => internal.tapErrorSync(fx, f).addTrace(trace))
992
1040
 
993
1041
  export const throttle: {
994
1042
  (delay: Duration): <R, E, A>(fx: Fx<R, E, A>) => Fx<R, E, A>
995
1043
  <R, E, A>(fx: Fx<R, E, A>, delay: Duration): Fx<R, E, A>
996
- } = dualWithTrace(2, (trace) => (fx, delay) => internal.throttle(fx, delay).traced(trace))
1044
+ } = dualWithTrace(2, (trace) => (fx, delay) => internal.throttle(fx, delay).addTrace(trace))
997
1045
 
998
1046
  export const toArray: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R | Scope.Scope, E, Array<A>> =
999
1047
  methodWithTrace((trace) => (fx) => internal.toArray(fx).traced(trace))