effect 4.0.0-beta.68 → 4.0.0-beta.69

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 (76) hide show
  1. package/dist/Channel.d.ts.map +1 -1
  2. package/dist/Channel.js +1 -1
  3. package/dist/Channel.js.map +1 -1
  4. package/dist/Effect.d.ts +485 -485
  5. package/dist/Effect.js +218 -218
  6. package/dist/index.d.ts +21 -29
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +21 -29
  9. package/dist/index.js.map +1 -1
  10. package/dist/unstable/ai/index.d.ts +1 -1
  11. package/dist/unstable/ai/index.js +1 -1
  12. package/dist/unstable/cli/Flag.d.ts +23 -0
  13. package/dist/unstable/cli/Flag.d.ts.map +1 -1
  14. package/dist/unstable/cli/Flag.js +23 -0
  15. package/dist/unstable/cli/Flag.js.map +1 -1
  16. package/dist/unstable/cli/Param.d.ts +2 -0
  17. package/dist/unstable/cli/Param.d.ts.map +1 -1
  18. package/dist/unstable/cli/Param.js +27 -0
  19. package/dist/unstable/cli/Param.js.map +1 -1
  20. package/dist/unstable/cli/index.d.ts +30 -0
  21. package/dist/unstable/cli/index.d.ts.map +1 -1
  22. package/dist/unstable/cli/index.js +1 -1
  23. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  24. package/dist/unstable/cli/internal/command.js +3 -0
  25. package/dist/unstable/cli/internal/command.js.map +1 -1
  26. package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
  27. package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
  28. package/dist/unstable/cli/internal/help.d.ts.map +1 -1
  29. package/dist/unstable/cli/internal/help.js +10 -0
  30. package/dist/unstable/cli/internal/help.js.map +1 -1
  31. package/dist/unstable/cli/internal/parser.js +3 -0
  32. package/dist/unstable/cli/internal/parser.js.map +1 -1
  33. package/dist/unstable/cluster/index.d.ts +1 -1
  34. package/dist/unstable/cluster/index.js +1 -1
  35. package/dist/unstable/observability/index.d.ts +1 -1
  36. package/dist/unstable/observability/index.js +1 -1
  37. package/dist/unstable/process/index.d.ts +1 -1
  38. package/dist/unstable/process/index.js +1 -1
  39. package/dist/unstable/reactivity/index.d.ts +2 -3
  40. package/dist/unstable/reactivity/index.d.ts.map +1 -1
  41. package/dist/unstable/reactivity/index.js +2 -3
  42. package/dist/unstable/reactivity/index.js.map +1 -1
  43. package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
  44. package/dist/unstable/rpc/RpcWorker.js +1 -1
  45. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  46. package/dist/unstable/sql/Migrator.d.ts +6 -4
  47. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  48. package/dist/unstable/sql/Migrator.js +9 -7
  49. package/dist/unstable/sql/Migrator.js.map +1 -1
  50. package/dist/unstable/sql/index.d.ts +0 -1
  51. package/dist/unstable/sql/index.d.ts.map +1 -1
  52. package/dist/unstable/sql/index.js +0 -1
  53. package/dist/unstable/sql/index.js.map +1 -1
  54. package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
  55. package/dist/unstable/workflow/WorkflowEngine.js +5 -9
  56. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  57. package/package.json +3 -3
  58. package/src/Channel.ts +6 -1
  59. package/src/Effect.ts +491 -491
  60. package/src/index.ts +21 -29
  61. package/src/unstable/ai/index.ts +1 -1
  62. package/src/unstable/cli/Flag.ts +24 -0
  63. package/src/unstable/cli/Param.ts +32 -0
  64. package/src/unstable/cli/index.ts +1 -1
  65. package/src/unstable/cli/internal/command.ts +3 -0
  66. package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
  67. package/src/unstable/cli/internal/help.ts +10 -0
  68. package/src/unstable/cli/internal/parser.ts +3 -0
  69. package/src/unstable/cluster/index.ts +1 -1
  70. package/src/unstable/observability/index.ts +1 -1
  71. package/src/unstable/process/index.ts +1 -1
  72. package/src/unstable/reactivity/index.ts +2 -3
  73. package/src/unstable/rpc/RpcWorker.ts +3 -1
  74. package/src/unstable/sql/Migrator.ts +9 -7
  75. package/src/unstable/sql/index.ts +0 -1
  76. package/src/unstable/workflow/WorkflowEngine.ts +7 -11
package/src/Effect.ts CHANGED
@@ -20,7 +20,7 @@
20
20
  * - **Testable**: Built-in support for testing with controlled environments
21
21
  * - **Interruptible**: Effects can be safely interrupted and cancelled
22
22
  *
23
- * **Example** (Usage)
23
+ * **Example** (Creating and running effects)
24
24
  *
25
25
  * ```ts
26
26
  * import { Console, Effect } from "effect"
@@ -39,7 +39,7 @@
39
39
  * Effect.runPromise(program).then(console.log) // 13
40
40
  * ```
41
41
  *
42
- * **Example** (Usage)
42
+ * **Example** (Handling typed failures)
43
43
  *
44
44
  * ```ts
45
45
  * import { Data, Effect } from "effect"
@@ -239,7 +239,7 @@ export type Services<T> = T extends Effect<infer _A, infer _E, infer _R> ? _R
239
239
  /**
240
240
  * Tests if a value is an `Effect`.
241
241
  *
242
- * **Example** (Usage)
242
+ * **Example** (Checking whether a value is an Effect)
243
243
  *
244
244
  * ```ts
245
245
  * import { Effect } from "effect"
@@ -414,7 +414,7 @@ export declare namespace All {
414
414
  * `Result` in the same output shape. Use `discard: true` to ignore successful
415
415
  * values and return `void`.
416
416
  *
417
- * **Example** (Combining Effects in Tuples)
417
+ * **Example** (Collecting tuple results in order)
418
418
  *
419
419
  * ```ts
420
420
  * import { Console, Effect } from "effect"
@@ -435,7 +435,7 @@ export declare namespace All {
435
435
  * // [ 42, 'Hello' ]
436
436
  * ```
437
437
  *
438
- * **Example** (Combining Effects in Iterables)
438
+ * **Example** (Collecting iterable results in order)
439
439
  *
440
440
  * ```ts
441
441
  * import { Console, Effect } from "effect"
@@ -456,7 +456,7 @@ export declare namespace All {
456
456
  * // [ 1, 2, 3 ]
457
457
  * ```
458
458
  *
459
- * **Example** (Combining Effects in Structs)
459
+ * **Example** (Collecting struct results by key)
460
460
  *
461
461
  * ```ts
462
462
  * import { Console, Effect } from "effect"
@@ -477,7 +477,7 @@ export declare namespace All {
477
477
  * // { a: 42, b: 'Hello' }
478
478
  * ```
479
479
  *
480
- * **Example** (Combining Effects in Records)
480
+ * **Example** (Collecting record results by key)
481
481
  *
482
482
  * ```ts
483
483
  * import { Console, Effect } from "effect"
@@ -498,7 +498,7 @@ export declare namespace All {
498
498
  * // { key1: 1, key2: 2 }
499
499
  * ```
500
500
  *
501
- * **Example** (Short-Circuiting Behavior)
501
+ * **Example** (Stopping on the first failure)
502
502
  *
503
503
  * ```ts
504
504
  * import { Console, Effect } from "effect"
@@ -551,7 +551,7 @@ export const all: <
551
551
  * This function runs every effect and never fails. Use `concurrency` to control
552
552
  * parallelism.
553
553
  *
554
- * **Example** (Usage)
554
+ * **Example** (Separating successes and failures)
555
555
  *
556
556
  * ```ts
557
557
  * import { Effect } from "effect"
@@ -580,7 +580,7 @@ export const partition: {
580
580
  * This function runs every effect and never fails. Use `concurrency` to control
581
581
  * parallelism.
582
582
  *
583
- * **Example** (Usage)
583
+ * **Example** (Separating successes and failures)
584
584
  *
585
585
  * ```ts
586
586
  * import { Effect } from "effect"
@@ -612,7 +612,7 @@ export const partition: {
612
612
  * This function runs every effect and never fails. Use `concurrency` to control
613
613
  * parallelism.
614
614
  *
615
- * **Example** (Usage)
615
+ * **Example** (Separating successes and failures)
616
616
  *
617
617
  * ```ts
618
618
  * import { Effect } from "effect"
@@ -645,7 +645,7 @@ export const partition: {
645
645
  * Use `discard: true` to ignore successful values while still validating all
646
646
  * elements.
647
647
  *
648
- * **Example** (Usage)
648
+ * **Example** (Validating every element)
649
649
  *
650
650
  * ```ts
651
651
  * import { Effect } from "effect"
@@ -682,7 +682,7 @@ export const validate: {
682
682
  * Use `discard: true` to ignore successful values while still validating all
683
683
  * elements.
684
684
  *
685
- * **Example** (Usage)
685
+ * **Example** (Validating every element)
686
686
  *
687
687
  * ```ts
688
688
  * import { Effect } from "effect"
@@ -725,7 +725,7 @@ export const validate: {
725
725
  * Use `discard: true` to ignore successful values while still validating all
726
726
  * elements.
727
727
  *
728
- * **Example** (Usage)
728
+ * **Example** (Validating every element)
729
729
  *
730
730
  * ```ts
731
731
  * import { Effect } from "effect"
@@ -768,7 +768,7 @@ export const validate: {
768
768
  * Use `discard: true` to ignore successful values while still validating all
769
769
  * elements.
770
770
  *
771
- * **Example** (Usage)
771
+ * **Example** (Validating every element)
772
772
  *
773
773
  * ```ts
774
774
  * import { Effect } from "effect"
@@ -812,7 +812,7 @@ export const validate: {
812
812
  * Use `discard: true` to ignore successful values while still validating all
813
813
  * elements.
814
814
  *
815
- * **Example** (Usage)
815
+ * **Example** (Validating every element)
816
816
  *
817
817
  * ```ts
818
818
  * import { Effect } from "effect"
@@ -854,7 +854,7 @@ export const validate: {
854
854
  * The predicate receives the element and its index. Evaluation short-circuits
855
855
  * as soon as an element matches.
856
856
  *
857
- * **Example** (Usage)
857
+ * **Example** (Finding the first successful match)
858
858
  *
859
859
  * ```ts
860
860
  * import { Effect } from "effect"
@@ -875,7 +875,7 @@ export const findFirst: {
875
875
  * The predicate receives the element and its index. Evaluation short-circuits
876
876
  * as soon as an element matches.
877
877
  *
878
- * **Example** (Usage)
878
+ * **Example** (Finding the first successful match)
879
879
  *
880
880
  * ```ts
881
881
  * import { Effect } from "effect"
@@ -896,7 +896,7 @@ export const findFirst: {
896
896
  * The predicate receives the element and its index. Evaluation short-circuits
897
897
  * as soon as an element matches.
898
898
  *
899
- * **Example** (Usage)
899
+ * **Example** (Finding the first successful match)
900
900
  *
901
901
  * ```ts
902
902
  * import { Effect } from "effect"
@@ -976,7 +976,7 @@ export const findFirstFilter: {
976
976
  *
977
977
  * @see {@link all} for combining multiple effects into one.
978
978
  *
979
- * **Example** (Applying Effects to Iterable Elements)
979
+ * **Example** (Mapping over an iterable with effects)
980
980
  *
981
981
  * ```ts
982
982
  * import { Console, Effect } from "effect"
@@ -997,7 +997,7 @@ export const findFirstFilter: {
997
997
  * // [ 2, 4, 6, 8, 10 ]
998
998
  * ```
999
999
  *
1000
- * **Example** (Using discard to Ignore Results)
1000
+ * **Example** (Running effects without collecting results)
1001
1001
  *
1002
1002
  * ```ts
1003
1003
  * import { Console, Effect } from "effect"
@@ -1047,7 +1047,7 @@ export const forEach: {
1047
1047
  *
1048
1048
  * @see {@link all} for combining multiple effects into one.
1049
1049
  *
1050
- * **Example** (Applying Effects to Iterable Elements)
1050
+ * **Example** (Mapping over an iterable with effects)
1051
1051
  *
1052
1052
  * ```ts
1053
1053
  * import { Console, Effect } from "effect"
@@ -1068,7 +1068,7 @@ export const forEach: {
1068
1068
  * // [ 2, 4, 6, 8, 10 ]
1069
1069
  * ```
1070
1070
  *
1071
- * **Example** (Using discard to Ignore Results)
1071
+ * **Example** (Running effects without collecting results)
1072
1072
  *
1073
1073
  * ```ts
1074
1074
  * import { Console, Effect } from "effect"
@@ -1121,7 +1121,7 @@ export const forEach: {
1121
1121
  *
1122
1122
  * @see {@link all} for combining multiple effects into one.
1123
1123
  *
1124
- * **Example** (Applying Effects to Iterable Elements)
1124
+ * **Example** (Mapping over an iterable with effects)
1125
1125
  *
1126
1126
  * ```ts
1127
1127
  * import { Console, Effect } from "effect"
@@ -1142,7 +1142,7 @@ export const forEach: {
1142
1142
  * // [ 2, 4, 6, 8, 10 ]
1143
1143
  * ```
1144
1144
  *
1145
- * **Example** (Using discard to Ignore Results)
1145
+ * **Example** (Running effects without collecting results)
1146
1146
  *
1147
1147
  * ```ts
1148
1148
  * import { Console, Effect } from "effect"
@@ -1178,7 +1178,7 @@ export const forEach: {
1178
1178
  /**
1179
1179
  * Executes a body effect repeatedly while a condition holds true.
1180
1180
  *
1181
- * **Example** (Usage)
1181
+ * **Example** (Repeating an effectful loop)
1182
1182
  *
1183
1183
  * ```ts
1184
1184
  * import { Effect } from "effect"
@@ -1238,7 +1238,7 @@ export const whileLoop: <A, E, R>(options: {
1238
1238
  *
1239
1239
  * @see {@link tryPromise} for a version that can handle failures.
1240
1240
  *
1241
- * **Example** (Delayed Message)
1241
+ * **Example** (Wrapping a non-rejecting Promise)
1242
1242
  *
1243
1243
  * ```ts
1244
1244
  * import { Effect } from "effect"
@@ -1291,7 +1291,7 @@ export const promise: <A>(
1291
1291
  * An optional `AbortSignal` can be provided to allow for interruption of the
1292
1292
  * wrapped `Promise` API.
1293
1293
  *
1294
- * **Example** (Fetching a TODO Item)
1294
+ * **Example** (Wrapping a fetch request that may fail)
1295
1295
  *
1296
1296
  * ```ts
1297
1297
  * import { Effect } from "effect"
@@ -1307,7 +1307,7 @@ export const promise: <A>(
1307
1307
  * const program = getTodo(1)
1308
1308
  * ```
1309
1309
  *
1310
- * **Example** (Custom Error Handling)
1310
+ * **Example** (Mapping Promise rejections to a tagged error)
1311
1311
  *
1312
1312
  * ```ts
1313
1313
  * import { Data, Effect } from "effect"
@@ -1347,7 +1347,7 @@ export const tryPromise: <A, E = Cause.UnknownError>(
1347
1347
  *
1348
1348
  * @see {@link fail} to create an effect that represents a failure.
1349
1349
  *
1350
- * **Example** (Creating a Successful Effect)
1350
+ * **Example** (Creating a successful effect)
1351
1351
  *
1352
1352
  * ```ts
1353
1353
  * import { Effect } from "effect"
@@ -1367,7 +1367,7 @@ export const succeed: <A>(value: A) => Effect<A> = internal.succeed
1367
1367
  /**
1368
1368
  * Returns an effect which succeeds with `None`.
1369
1369
  *
1370
- * **Example** (Usage)
1370
+ * **Example** (Succeeding with Option.none)
1371
1371
  *
1372
1372
  * ```ts
1373
1373
  * import { Effect } from "effect"
@@ -1386,7 +1386,7 @@ export const succeedNone: Effect<Option<never>> = internal.succeedNone
1386
1386
  /**
1387
1387
  * Returns an effect which succeeds with the value wrapped in a `Some`.
1388
1388
  *
1389
- * **Example** (Usage)
1389
+ * **Example** (Succeeding with Option.some)
1390
1390
  *
1391
1391
  * ```ts
1392
1392
  * import { Effect } from "effect"
@@ -1416,7 +1416,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
1416
1416
  * - **Handling Circular Dependencies**: Useful in managing circular dependencies, such as recursive functions that need to avoid eager evaluation to prevent stack overflow.
1417
1417
  * - **Unifying Return Types**: Can help TypeScript unify return types in situations where multiple branches of logic return different effects, simplifying type inference.
1418
1418
  *
1419
- * **Example** (Lazy Evaluation with Side Effects)
1419
+ * **Example** (Lazily evaluating side effects)
1420
1420
  *
1421
1421
  * ```ts
1422
1422
  * import { Effect } from "effect"
@@ -1434,7 +1434,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
1434
1434
  * console.log(Effect.runSync(good)) // Output: 2
1435
1435
  * ```
1436
1436
  *
1437
- * **Example** (Recursive Fibonacci)
1437
+ * **Example** (Suspending recursive Fibonacci evaluation)
1438
1438
  *
1439
1439
  * ```ts
1440
1440
  * import { Effect } from "effect"
@@ -1460,7 +1460,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
1460
1460
  * // Output: 3524578
1461
1461
  * ```
1462
1462
  *
1463
- * **Example** (Using Effect.suspend to Help TypeScript Infer Types)
1463
+ * **Example** (Helping TypeScript infer recursive effect types)
1464
1464
  *
1465
1465
  * ```ts
1466
1466
  * import { Effect } from "effect"
@@ -1511,7 +1511,7 @@ export const suspend: <A, E, R>(
1511
1511
  *
1512
1512
  * @see {@link try_ | try} for a version that can handle failures.
1513
1513
  *
1514
- * **Example** (Logging a Message)
1514
+ * **Example** (Capturing synchronous logging in an Effect)
1515
1515
  *
1516
1516
  * ```ts
1517
1517
  * import { Effect } from "effect"
@@ -1564,7 +1564,7 @@ export {
1564
1564
  * Use `Effect.callback` when integrating APIs that complete through callbacks
1565
1565
  * instead of returning a `Promise`.
1566
1566
  *
1567
- * **Example** (Usage)
1567
+ * **Example** (Integrating callback APIs)
1568
1568
  *
1569
1569
  * ```ts
1570
1570
  * import { Effect } from "effect"
@@ -1596,7 +1596,7 @@ export const callback: <A, E = never, R = never>(
1596
1596
  * Returns an effect that will never produce anything. The moral equivalent of
1597
1597
  * `while(true) {}`, only without the wasted CPU cycles.
1598
1598
  *
1599
- * **Example** (Usage)
1599
+ * **Example** (Creating a never-ending effect)
1600
1600
  *
1601
1601
  * ```ts
1602
1602
  * import { Effect } from "effect"
@@ -1620,7 +1620,7 @@ export const never: Effect<never> = internal.never
1620
1620
  * An `Effect` containing an empty record `{}`, used as the starting point for
1621
1621
  * do notation chains.
1622
1622
  *
1623
- * **Example** (Usage)
1623
+ * **Example** (Starting do notation)
1624
1624
  *
1625
1625
  * ```ts
1626
1626
  * import { Effect, pipe } from "effect"
@@ -1728,7 +1728,7 @@ export const bind: {
1728
1728
  * explicit control over the execution of effects. You can `yield*` values from
1729
1729
  * effects and return the final result at the end.
1730
1730
  *
1731
- * **Example** (Usage)
1731
+ * **Example** (Sequencing effects with generators)
1732
1732
  *
1733
1733
  * ```ts
1734
1734
  * import { Data, Effect } from "effect"
@@ -1780,7 +1780,7 @@ export const gen: {
1780
1780
  * explicit control over the execution of effects. You can `yield*` values from
1781
1781
  * effects and return the final result at the end.
1782
1782
  *
1783
- * **Example** (Usage)
1783
+ * **Example** (Sequencing effects with generators)
1784
1784
  *
1785
1785
  * ```ts
1786
1786
  * import { Data, Effect } from "effect"
@@ -1840,7 +1840,7 @@ export const gen: {
1840
1840
  * explicit control over the execution of effects. You can `yield*` values from
1841
1841
  * effects and return the final result at the end.
1842
1842
  *
1843
- * **Example** (Usage)
1843
+ * **Example** (Sequencing effects with generators)
1844
1844
  *
1845
1845
  * ```ts
1846
1846
  * import { Data, Effect } from "effect"
@@ -1918,7 +1918,7 @@ export namespace gen {
1918
1918
  *
1919
1919
  * @see {@link succeed} to create an effect that represents a successful value.
1920
1920
  *
1921
- * **Example** (Creating a Failed Effect)
1921
+ * **Example** (Creating a failed effect)
1922
1922
  *
1923
1923
  * ```ts
1924
1924
  * import { Data, Effect } from "effect"
@@ -1943,7 +1943,7 @@ export const fail: <E>(error: E) => Effect<never, E> = internal.fail
1943
1943
  * This function is useful when you need to create an error effect but want to
1944
1944
  * defer the computation of the error value until the effect is actually run.
1945
1945
  *
1946
- * **Example** (Usage)
1946
+ * **Example** (Lazily creating failures)
1947
1947
  *
1948
1948
  * ```ts
1949
1949
  * import { Data, Effect } from "effect"
@@ -1967,7 +1967,7 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
1967
1967
  * This function allows you to create effects that fail with complex error
1968
1968
  * structures, including multiple errors, defects, interruptions, and more.
1969
1969
  *
1970
- * **Example** (Usage)
1970
+ * **Example** (Failing with a full Cause)
1971
1971
  *
1972
1972
  * ```ts
1973
1973
  * import { Cause, Effect } from "effect"
@@ -1991,7 +1991,7 @@ export const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E> = interna
1991
1991
  * This function is useful when you need to create a failure effect with a
1992
1992
  * complex cause but want to defer the computation until the effect is run.
1993
1993
  *
1994
- * **Example** (Usage)
1994
+ * **Example** (Lazily creating a Cause)
1995
1995
  *
1996
1996
  * ```ts
1997
1997
  * import { Cause, Effect } from "effect"
@@ -2030,7 +2030,7 @@ export const failCauseSync: <E>(
2030
2030
  *
2031
2031
  * @see {@link die} for a variant that dies with an already computed defect.
2032
2032
  *
2033
- * **Example** (Terminating on Division by Zero with a Specified Error)
2033
+ * **Example** (Failing when division by zero)
2034
2034
  *
2035
2035
  * ```ts
2036
2036
  * import { Effect } from "effect"
@@ -2084,7 +2084,7 @@ export {
2084
2084
  * @see {@link sync} if the effectful computation is synchronous and does not
2085
2085
  * throw errors.
2086
2086
  *
2087
- * **Example** (Basic Usage with Default Error Handling)
2087
+ * **Example** (Parsing JSON with typed error mapping)
2088
2088
  *
2089
2089
  * ```ts
2090
2090
  * import { Effect } from "effect"
@@ -2104,7 +2104,7 @@ export {
2104
2104
  * // Output: Exit.failure with Error
2105
2105
  * ```
2106
2106
  *
2107
- * **Example** (Custom Error Handling)
2107
+ * **Example** (Mapping synchronous exceptions to a tagged error)
2108
2108
  *
2109
2109
  * ```ts
2110
2110
  * import { Data, Effect } from "effect"
@@ -2130,7 +2130,7 @@ export {
2130
2130
  /**
2131
2131
  * Yields control back to the Effect runtime, allowing other fibers to execute.
2132
2132
  *
2133
- * **Example** (Usage)
2133
+ * **Example** (Yielding to other fibers)
2134
2134
  *
2135
2135
  * ```ts
2136
2136
  * import { Effect } from "effect"
@@ -2152,7 +2152,7 @@ export const yieldNow: Effect<void> = internal.yieldNow
2152
2152
  /**
2153
2153
  * Yields control back to the Effect runtime with a specified priority, allowing other fibers to execute.
2154
2154
  *
2155
- * **Example** (Usage)
2155
+ * **Example** (Yielding with priority)
2156
2156
  *
2157
2157
  * ```ts
2158
2158
  * import { Effect } from "effect"
@@ -2174,7 +2174,7 @@ export const yieldNowWith: (priority?: number) => Effect<void> = internal.yieldN
2174
2174
  /**
2175
2175
  * Provides access to the current fiber within an effect computation.
2176
2176
  *
2177
- * **Example** (Usage)
2177
+ * **Example** (Reading the current fiber)
2178
2178
  *
2179
2179
  * ```ts
2180
2180
  * import { Effect } from "effect"
@@ -2201,7 +2201,7 @@ export const withFiber: <A, E = never, R = never>(
2201
2201
  /**
2202
2202
  * Converts a `Result` to an `Effect`.
2203
2203
  *
2204
- * **Example** (Usage)
2204
+ * **Example** (Converting a Result into an Effect)
2205
2205
  *
2206
2206
  * ```ts
2207
2207
  * import { Effect, Result } from "effect"
@@ -2228,7 +2228,7 @@ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A, E> = i
2228
2228
  * `Option.some` becomes a successful effect with the contained value, while
2229
2229
  * `Option.none` becomes a failed effect with `NoSuchElementError`.
2230
2230
  *
2231
- * **Example** (Usage)
2231
+ * **Example** (Converting an Option into an Effect)
2232
2232
  *
2233
2233
  * ```ts
2234
2234
  * import { Effect, Option } from "effect"
@@ -2255,7 +2255,7 @@ export const fromOption: <A>(
2255
2255
  * Converts a nullable value to an `Effect`, failing with a `NoSuchElementError`
2256
2256
  * when the value is `null` or `undefined`.
2257
2257
  *
2258
- * **Example** (Usage)
2258
+ * **Example** (Failing on nullish values)
2259
2259
  *
2260
2260
  * ```ts
2261
2261
  * import { Console, Effect } from "effect"
@@ -2312,7 +2312,7 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
2312
2312
  * step produces a new `Effect` while flattening any nested effects that may
2313
2313
  * occur.
2314
2314
  *
2315
- * **Example** (Usage)
2315
+ * **Example** (Sequencing dependent effects)
2316
2316
  *
2317
2317
  * ```ts
2318
2318
  * import { Data, Effect, pipe } from "effect"
@@ -2381,7 +2381,7 @@ export const flatMap: {
2381
2381
  * step produces a new `Effect` while flattening any nested effects that may
2382
2382
  * occur.
2383
2383
  *
2384
- * **Example** (Usage)
2384
+ * **Example** (Sequencing dependent effects)
2385
2385
  *
2386
2386
  * ```ts
2387
2387
  * import { Data, Effect, pipe } from "effect"
@@ -2450,7 +2450,7 @@ export const flatMap: {
2450
2450
  * step produces a new `Effect` while flattening any nested effects that may
2451
2451
  * occur.
2452
2452
  *
2453
- * **Example** (Usage)
2453
+ * **Example** (Sequencing dependent effects)
2454
2454
  *
2455
2455
  * ```ts
2456
2456
  * import { Data, Effect, pipe } from "effect"
@@ -2490,7 +2490,7 @@ export const flatMap: {
2490
2490
  /**
2491
2491
  * Flattens an `Effect` that produces another `Effect` into a single effect.
2492
2492
  *
2493
- * **Example** (Usage)
2493
+ * **Example** (Flattening nested effects)
2494
2494
  *
2495
2495
  * ```ts
2496
2496
  * import { Console, Effect } from "effect"
@@ -2539,7 +2539,7 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
2539
2539
  * Failures or requirements from either effect are preserved in the returned
2540
2540
  * effect.
2541
2541
  *
2542
- * **Example** (Applying a Discount Based on Fetched Amount)
2542
+ * **Example** (Sequencing a discount calculation after fetching a total)
2543
2543
  *
2544
2544
  * ```ts
2545
2545
  * import { Data, Effect, pipe } from "effect"
@@ -2612,7 +2612,7 @@ export const andThen: {
2612
2612
  * Failures or requirements from either effect are preserved in the returned
2613
2613
  * effect.
2614
2614
  *
2615
- * **Example** (Applying a Discount Based on Fetched Amount)
2615
+ * **Example** (Sequencing a discount calculation after fetching a total)
2616
2616
  *
2617
2617
  * ```ts
2618
2618
  * import { Data, Effect, pipe } from "effect"
@@ -2685,7 +2685,7 @@ export const andThen: {
2685
2685
  * Failures or requirements from either effect are preserved in the returned
2686
2686
  * effect.
2687
2687
  *
2688
- * **Example** (Applying a Discount Based on Fetched Amount)
2688
+ * **Example** (Sequencing a discount calculation after fetching a total)
2689
2689
  *
2690
2690
  * ```ts
2691
2691
  * import { Data, Effect, pipe } from "effect"
@@ -2758,7 +2758,7 @@ export const andThen: {
2758
2758
  * Failures or requirements from either effect are preserved in the returned
2759
2759
  * effect.
2760
2760
  *
2761
- * **Example** (Applying a Discount Based on Fetched Amount)
2761
+ * **Example** (Sequencing a discount calculation after fetching a total)
2762
2762
  *
2763
2763
  * ```ts
2764
2764
  * import { Data, Effect, pipe } from "effect"
@@ -2831,7 +2831,7 @@ export const andThen: {
2831
2831
  * Failures or requirements from either effect are preserved in the returned
2832
2832
  * effect.
2833
2833
  *
2834
- * **Example** (Applying a Discount Based on Fetched Amount)
2834
+ * **Example** (Sequencing a discount calculation after fetching a total)
2835
2835
  *
2836
2836
  * ```ts
2837
2837
  * import { Data, Effect, pipe } from "effect"
@@ -3172,7 +3172,7 @@ export const tap: {
3172
3172
  * The resulting effect cannot fail directly because all recoverable failures
3173
3173
  * are represented inside the `Result` type.
3174
3174
  *
3175
- * **Example** (Usage)
3175
+ * **Example** (Capturing success or failure as Result)
3176
3176
  *
3177
3177
  * ```ts
3178
3178
  * import { Effect } from "effect"
@@ -3206,7 +3206,7 @@ export const result: <A, E, R>(self: Effect<A, E, R>) => Effect<Result.Result<A,
3206
3206
  * Success values become `Option.some`, recoverable failures become
3207
3207
  * `Option.none`, and defects still fail the effect.
3208
3208
  *
3209
- * **Example** (Usage)
3209
+ * **Example** (Capturing success or failure as Option)
3210
3210
  *
3211
3211
  * ```ts
3212
3212
  * import { Console, Effect, Option } from "effect"
@@ -3245,7 +3245,7 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
3245
3245
  * the `Exit.Failure` type. The error type is set to `never`, indicating that
3246
3246
  * the effect is structured to never fail directly.
3247
3247
  *
3248
- * **Example** (Usage)
3248
+ * **Example** (Capturing completion as Exit)
3249
3249
  *
3250
3250
  * ```ts
3251
3251
  * import { Effect } from "effect"
@@ -3295,7 +3295,7 @@ export const exit: <A, E, R>(
3295
3295
  * effect is not modified. Instead, a new effect is returned with the updated
3296
3296
  * value.
3297
3297
  *
3298
- * **Example** (Adding a Service Charge)
3298
+ * **Example** (Adding a service charge)
3299
3299
  *
3300
3300
  * ```ts
3301
3301
  * import { Effect, pipe } from "effect"
@@ -3343,7 +3343,7 @@ export const map: {
3343
3343
  * effect is not modified. Instead, a new effect is returned with the updated
3344
3344
  * value.
3345
3345
  *
3346
- * **Example** (Adding a Service Charge)
3346
+ * **Example** (Adding a service charge)
3347
3347
  *
3348
3348
  * ```ts
3349
3349
  * import { Effect, pipe } from "effect"
@@ -3391,7 +3391,7 @@ export const map: {
3391
3391
  * effect is not modified. Instead, a new effect is returned with the updated
3392
3392
  * value.
3393
3393
  *
3394
- * **Example** (Adding a Service Charge)
3394
+ * **Example** (Adding a service charge)
3395
3395
  *
3396
3396
  * ```ts
3397
3397
  * import { Effect, pipe } from "effect"
@@ -3425,7 +3425,7 @@ export const map: {
3425
3425
  * `as` allows you to ignore the original value inside an effect and
3426
3426
  * replace it with a new constant value.
3427
3427
  *
3428
- * **Example** (Replacing a Value)
3428
+ * **Example** (Replacing a success value)
3429
3429
  *
3430
3430
  * ```ts
3431
3431
  * import { Effect, pipe } from "effect"
@@ -3447,7 +3447,7 @@ export const as: {
3447
3447
  * `as` allows you to ignore the original value inside an effect and
3448
3448
  * replace it with a new constant value.
3449
3449
  *
3450
- * **Example** (Replacing a Value)
3450
+ * **Example** (Replacing a success value)
3451
3451
  *
3452
3452
  * ```ts
3453
3453
  * import { Effect, pipe } from "effect"
@@ -3469,7 +3469,7 @@ export const as: {
3469
3469
  * `as` allows you to ignore the original value inside an effect and
3470
3470
  * replace it with a new constant value.
3471
3471
  *
3472
- * **Example** (Replacing a Value)
3472
+ * **Example** (Replacing a success value)
3473
3473
  *
3474
3474
  * ```ts
3475
3475
  * import { Effect, pipe } from "effect"
@@ -3492,7 +3492,7 @@ export const as: {
3492
3492
  * in an `Option` value. If the original `Effect` value fails, the returned
3493
3493
  * `Effect` value will also fail.
3494
3494
  *
3495
- * **Example** (Usage)
3495
+ * **Example** (Wrapping success in Option.some)
3496
3496
  *
3497
3497
  * ```ts
3498
3498
  * import { Effect } from "effect"
@@ -3514,7 +3514,7 @@ export const asSome: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, E, R>
3514
3514
  * succeed. If the original `Effect` value fails, the returned `Effect` value
3515
3515
  * will fail with the same error.
3516
3516
  *
3517
- * **Example** (Usage)
3517
+ * **Example** (Discarding success values)
3518
3518
  *
3519
3519
  * ```ts
3520
3520
  * import { Effect } from "effect"
@@ -3539,7 +3539,7 @@ export const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E, R> = in
3539
3539
  * be helpful in scenarios where you want to handle a success as a failure or
3540
3540
  * treat an error as a valid result.
3541
3541
  *
3542
- * **Example** (Usage)
3542
+ * **Example** (Swapping success and failure channels)
3543
3543
  *
3544
3544
  * ```ts
3545
3545
  * import { Effect } from "effect"
@@ -3576,7 +3576,7 @@ export const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R> = interna
3576
3576
  * @see {@link zipWith} for a version that combines the results with a custom function.
3577
3577
  * @see {@link validate} for a version that accumulates errors.
3578
3578
  *
3579
- * **Example** (Combining Two Effects Sequentially)
3579
+ * **Example** (Combining two effects sequentially)
3580
3580
  *
3581
3581
  * ```ts
3582
3582
  * import { Effect } from "effect"
@@ -3603,7 +3603,7 @@ export const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R> = interna
3603
3603
  * // [ 1, 'hello' ]
3604
3604
  * ```
3605
3605
  *
3606
- * **Example** (Combining Two Effects Concurrently)
3606
+ * **Example** (Combining two effects concurrently)
3607
3607
  *
3608
3608
  * ```ts
3609
3609
  * import { Effect } from "effect"
@@ -3649,7 +3649,7 @@ export const zip: {
3649
3649
  * @see {@link zipWith} for a version that combines the results with a custom function.
3650
3650
  * @see {@link validate} for a version that accumulates errors.
3651
3651
  *
3652
- * **Example** (Combining Two Effects Sequentially)
3652
+ * **Example** (Combining two effects sequentially)
3653
3653
  *
3654
3654
  * ```ts
3655
3655
  * import { Effect } from "effect"
@@ -3676,7 +3676,7 @@ export const zip: {
3676
3676
  * // [ 1, 'hello' ]
3677
3677
  * ```
3678
3678
  *
3679
- * **Example** (Combining Two Effects Concurrently)
3679
+ * **Example** (Combining two effects concurrently)
3680
3680
  *
3681
3681
  * ```ts
3682
3682
  * import { Effect } from "effect"
@@ -3725,7 +3725,7 @@ export const zip: {
3725
3725
  * @see {@link zipWith} for a version that combines the results with a custom function.
3726
3726
  * @see {@link validate} for a version that accumulates errors.
3727
3727
  *
3728
- * **Example** (Combining Two Effects Sequentially)
3728
+ * **Example** (Combining two effects sequentially)
3729
3729
  *
3730
3730
  * ```ts
3731
3731
  * import { Effect } from "effect"
@@ -3752,7 +3752,7 @@ export const zip: {
3752
3752
  * // [ 1, 'hello' ]
3753
3753
  * ```
3754
3754
  *
3755
- * **Example** (Combining Two Effects Concurrently)
3755
+ * **Example** (Combining two effects concurrently)
3756
3756
  *
3757
3757
  * ```ts
3758
3758
  * import { Effect } from "effect"
@@ -3801,7 +3801,7 @@ export const zip: {
3801
3801
  * By default, the effects are run sequentially. To execute them concurrently,
3802
3802
  * use the `{ concurrent: true }` option.
3803
3803
  *
3804
- * **Example** (Combining Effects with a Custom Function)
3804
+ * **Example** (Combining two success values with a function)
3805
3805
  *
3806
3806
  * ```ts
3807
3807
  * import { Effect } from "effect"
@@ -3848,7 +3848,7 @@ export const zipWith: {
3848
3848
  * By default, the effects are run sequentially. To execute them concurrently,
3849
3849
  * use the `{ concurrent: true }` option.
3850
3850
  *
3851
- * **Example** (Combining Effects with a Custom Function)
3851
+ * **Example** (Combining two success values with a function)
3852
3852
  *
3853
3853
  * ```ts
3854
3854
  * import { Effect } from "effect"
@@ -3899,7 +3899,7 @@ export const zipWith: {
3899
3899
  * By default, the effects are run sequentially. To execute them concurrently,
3900
3900
  * use the `{ concurrent: true }` option.
3901
3901
  *
3902
- * **Example** (Combining Effects with a Custom Function)
3902
+ * **Example** (Combining two success values with a function)
3903
3903
  *
3904
3904
  * ```ts
3905
3905
  * import { Effect } from "effect"
@@ -3988,7 +3988,7 @@ export {
3988
3988
  * The error type must have a readonly `_tag` field to use `catchTag`. This
3989
3989
  * field is used to identify and match errors.
3990
3990
  *
3991
- * **Example** (Usage)
3991
+ * **Example** (Handling a tagged error)
3992
3992
  *
3993
3993
  * ```ts
3994
3994
  * import { Effect } from "effect"
@@ -4030,7 +4030,7 @@ export const catchTag: {
4030
4030
  * The error type must have a readonly `_tag` field to use `catchTag`. This
4031
4031
  * field is used to identify and match errors.
4032
4032
  *
4033
- * **Example** (Usage)
4033
+ * **Example** (Handling a tagged error)
4034
4034
  *
4035
4035
  * ```ts
4036
4036
  * import { Effect } from "effect"
@@ -4087,7 +4087,7 @@ export const catchTag: {
4087
4087
  * The error type must have a readonly `_tag` field to use `catchTag`. This
4088
4088
  * field is used to identify and match errors.
4089
4089
  *
4090
- * **Example** (Usage)
4090
+ * **Example** (Handling a tagged error)
4091
4091
  *
4092
4092
  * ```ts
4093
4093
  * import { Effect } from "effect"
@@ -4150,7 +4150,7 @@ export const catchTag: {
4150
4150
  * The error type must have a readonly `_tag` field to use `catchTag`. This
4151
4151
  * field is used to identify and match errors.
4152
4152
  *
4153
- * **Example** (Usage)
4153
+ * **Example** (Handling multiple tagged errors)
4154
4154
  *
4155
4155
  * ```ts
4156
4156
  * import { Data, Effect } from "effect"
@@ -4194,7 +4194,7 @@ export const catchTags: {
4194
4194
  * The error type must have a readonly `_tag` field to use `catchTag`. This
4195
4195
  * field is used to identify and match errors.
4196
4196
  *
4197
- * **Example** (Usage)
4197
+ * **Example** (Handling multiple tagged errors)
4198
4198
  *
4199
4199
  * ```ts
4200
4200
  * import { Data, Effect } from "effect"
@@ -4266,7 +4266,7 @@ export const catchTags: {
4266
4266
  * The error type must have a readonly `_tag` field to use `catchTag`. This
4267
4267
  * field is used to identify and match errors.
4268
4268
  *
4269
- * **Example** (Usage)
4269
+ * **Example** (Handling multiple tagged errors)
4270
4270
  *
4271
4271
  * ```ts
4272
4272
  * import { Data, Effect } from "effect"
@@ -4332,7 +4332,7 @@ export const catchTags: {
4332
4332
  * Use this to handle nested error causes without removing the parent error
4333
4333
  * from the error channel. The handler receives the unwrapped reason.
4334
4334
  *
4335
- * **Example** (Usage)
4335
+ * **Example** (Handling an error reason)
4336
4336
  *
4337
4337
  * ```ts
4338
4338
  * import { Data, Effect } from "effect"
@@ -4369,7 +4369,7 @@ export const catchReason: {
4369
4369
  * Use this to handle nested error causes without removing the parent error
4370
4370
  * from the error channel. The handler receives the unwrapped reason.
4371
4371
  *
4372
- * **Example** (Usage)
4372
+ * **Example** (Handling an error reason)
4373
4373
  *
4374
4374
  * ```ts
4375
4375
  * import { Data, Effect } from "effect"
@@ -4431,7 +4431,7 @@ export const catchReason: {
4431
4431
  * Use this to handle nested error causes without removing the parent error
4432
4432
  * from the error channel. The handler receives the unwrapped reason.
4433
4433
  *
4434
- * **Example** (Usage)
4434
+ * **Example** (Handling an error reason)
4435
4435
  *
4436
4436
  * ```ts
4437
4437
  * import { Data, Effect } from "effect"
@@ -4487,7 +4487,7 @@ export const catchReason: {
4487
4487
  /**
4488
4488
  * Catches multiple reasons within a tagged error using an object of handlers.
4489
4489
  *
4490
- * **Example** (Usage)
4490
+ * **Example** (Handling multiple error reasons)
4491
4491
  *
4492
4492
  * ```ts
4493
4493
  * import { Data, Effect } from "effect"
@@ -4523,7 +4523,7 @@ export const catchReasons: {
4523
4523
  /**
4524
4524
  * Catches multiple reasons within a tagged error using an object of handlers.
4525
4525
  *
4526
- * **Example** (Usage)
4526
+ * **Example** (Handling multiple error reasons)
4527
4527
  *
4528
4528
  * ```ts
4529
4529
  * import { Data, Effect } from "effect"
@@ -4598,7 +4598,7 @@ export const catchReasons: {
4598
4598
  /**
4599
4599
  * Catches multiple reasons within a tagged error using an object of handlers.
4600
4600
  *
4601
- * **Example** (Usage)
4601
+ * **Example** (Handling multiple error reasons)
4602
4602
  *
4603
4603
  * ```ts
4604
4604
  * import { Data, Effect } from "effect"
@@ -4689,7 +4689,7 @@ export type TagsWithReason<E> = {
4689
4689
  * Promotes nested reason errors into the Effect error channel, replacing
4690
4690
  * the parent error.
4691
4691
  *
4692
- * **Example** (Usage)
4692
+ * **Example** (Extracting the reason from a tagged error)
4693
4693
  *
4694
4694
  * ```ts
4695
4695
  * import { Data, Effect } from "effect"
@@ -4721,7 +4721,7 @@ export const unwrapReason: {
4721
4721
  * Promotes nested reason errors into the Effect error channel, replacing
4722
4722
  * the parent error.
4723
4723
  *
4724
- * **Example** (Usage)
4724
+ * **Example** (Extracting the reason from a tagged error)
4725
4725
  *
4726
4726
  * ```ts
4727
4727
  * import { Data, Effect } from "effect"
@@ -4756,7 +4756,7 @@ export const unwrapReason: {
4756
4756
  * Promotes nested reason errors into the Effect error channel, replacing
4757
4757
  * the parent error.
4758
4758
  *
4759
- * **Example** (Usage)
4759
+ * **Example** (Extracting the reason from a tagged error)
4760
4760
  *
4761
4761
  * ```ts
4762
4762
  * import { Data, Effect } from "effect"
@@ -4808,7 +4808,7 @@ export const unwrapReason: {
4808
4808
  * they often indicate serious issues. However, in some cases, such as
4809
4809
  * dynamically loaded plugins, controlled recovery might be needed.
4810
4810
  *
4811
- * **Example** (Usage)
4811
+ * **Example** (Recovering from full failure causes)
4812
4812
  *
4813
4813
  * ```ts
4814
4814
  * import { Cause, Console, Effect } from "effect"
@@ -4848,7 +4848,7 @@ export const catchCause: {
4848
4848
  * they often indicate serious issues. However, in some cases, such as
4849
4849
  * dynamically loaded plugins, controlled recovery might be needed.
4850
4850
  *
4851
- * **Example** (Usage)
4851
+ * **Example** (Recovering from full failure causes)
4852
4852
  *
4853
4853
  * ```ts
4854
4854
  * import { Cause, Console, Effect } from "effect"
@@ -4888,7 +4888,7 @@ export const catchCause: {
4888
4888
  * they often indicate serious issues. However, in some cases, such as
4889
4889
  * dynamically loaded plugins, controlled recovery might be needed.
4890
4890
  *
4891
- * **Example** (Usage)
4891
+ * **Example** (Recovering from full failure causes)
4892
4892
  *
4893
4893
  * ```ts
4894
4894
  * import { Cause, Console, Effect } from "effect"
@@ -4932,7 +4932,7 @@ export const catchCause: {
4932
4932
  * they often indicate serious issues. In some cases, such as dynamically loaded
4933
4933
  * plugins, controlled recovery may be needed.
4934
4934
  *
4935
- * **Example** (Usage)
4935
+ * **Example** (Recovering from defects)
4936
4936
  *
4937
4937
  * ```ts
4938
4938
  * import { Console, Effect } from "effect"
@@ -4973,7 +4973,7 @@ export const catchDefect: {
4973
4973
  * they often indicate serious issues. In some cases, such as dynamically loaded
4974
4974
  * plugins, controlled recovery may be needed.
4975
4975
  *
4976
- * **Example** (Usage)
4976
+ * **Example** (Recovering from defects)
4977
4977
  *
4978
4978
  * ```ts
4979
4979
  * import { Console, Effect } from "effect"
@@ -5014,7 +5014,7 @@ export const catchDefect: {
5014
5014
  * they often indicate serious issues. In some cases, such as dynamically loaded
5015
5015
  * plugins, controlled recovery may be needed.
5016
5016
  *
5017
- * **Example** (Usage)
5017
+ * **Example** (Recovering from defects)
5018
5018
  *
5019
5019
  * ```ts
5020
5020
  * import { Console, Effect } from "effect"
@@ -5048,7 +5048,7 @@ export const catchDefect: {
5048
5048
  * matching. Non-matching errors re-fail with the original cause. Defects and
5049
5049
  * interrupts are not caught.
5050
5050
  *
5051
- * **Example** (Usage)
5051
+ * **Example** (Recovering when a predicate matches)
5052
5052
  *
5053
5053
  * ```ts
5054
5054
  * import { Data, Effect, Filter } from "effect"
@@ -5088,7 +5088,7 @@ export const catchIf: {
5088
5088
  * matching. Non-matching errors re-fail with the original cause. Defects and
5089
5089
  * interrupts are not caught.
5090
5090
  *
5091
- * **Example** (Usage)
5091
+ * **Example** (Recovering when a predicate matches)
5092
5092
  *
5093
5093
  * ```ts
5094
5094
  * import { Data, Effect, Filter } from "effect"
@@ -5132,7 +5132,7 @@ export const catchIf: {
5132
5132
  * matching. Non-matching errors re-fail with the original cause. Defects and
5133
5133
  * interrupts are not caught.
5134
5134
  *
5135
- * **Example** (Usage)
5135
+ * **Example** (Recovering when a predicate matches)
5136
5136
  *
5137
5137
  * ```ts
5138
5138
  * import { Data, Effect, Filter } from "effect"
@@ -5176,7 +5176,7 @@ export const catchIf: {
5176
5176
  * matching. Non-matching errors re-fail with the original cause. Defects and
5177
5177
  * interrupts are not caught.
5178
5178
  *
5179
- * **Example** (Usage)
5179
+ * **Example** (Recovering when a predicate matches)
5180
5180
  *
5181
5181
  * ```ts
5182
5182
  * import { Data, Effect, Filter } from "effect"
@@ -5221,7 +5221,7 @@ export const catchIf: {
5221
5221
  * matching. Non-matching errors re-fail with the original cause. Defects and
5222
5222
  * interrupts are not caught.
5223
5223
  *
5224
- * **Example** (Usage)
5224
+ * **Example** (Recovering when a predicate matches)
5225
5225
  *
5226
5226
  * ```ts
5227
5227
  * import { Data, Effect, Filter } from "effect"
@@ -5296,7 +5296,7 @@ export const catchFilter: {
5296
5296
  * Success values become `Option.some`, `NoSuchElementError` becomes
5297
5297
  * `Option.none`, and all other errors are preserved.
5298
5298
  *
5299
- * **Example** (Usage)
5299
+ * **Example** (Recovering from missing Option values)
5300
5300
  *
5301
5301
  * ```ts
5302
5302
  * import { Effect, Option } from "effect"
@@ -5322,7 +5322,7 @@ export const catchNoSuchElement: <A, E, R>(
5322
5322
  * that match a specific predicate. This is useful when you want to handle
5323
5323
  * only certain types of errors while letting others propagate.
5324
5324
  *
5325
- * **Example** (Usage)
5325
+ * **Example** (Recovering from selected causes)
5326
5326
  *
5327
5327
  * ```ts
5328
5328
  * import { Cause, Console, Effect } from "effect"
@@ -5356,7 +5356,7 @@ export const catchCauseIf: {
5356
5356
  * that match a specific predicate. This is useful when you want to handle
5357
5357
  * only certain types of errors while letting others propagate.
5358
5358
  *
5359
- * **Example** (Usage)
5359
+ * **Example** (Recovering from selected causes)
5360
5360
  *
5361
5361
  * ```ts
5362
5362
  * import { Cause, Console, Effect } from "effect"
@@ -5393,7 +5393,7 @@ export const catchCauseIf: {
5393
5393
  * that match a specific predicate. This is useful when you want to handle
5394
5394
  * only certain types of errors while letting others propagate.
5395
5395
  *
5396
- * **Example** (Usage)
5396
+ * **Example** (Recovering from selected causes)
5397
5397
  *
5398
5398
  * ```ts
5399
5399
  * import { Cause, Console, Effect } from "effect"
@@ -5469,7 +5469,7 @@ export const catchCauseFilter: {
5469
5469
  * @see {@link mapBoth} for a version that operates on both channels.
5470
5470
  * @see {@link mapError} if you want to replace the error with a new one.
5471
5471
  *
5472
- * **Example** (Usage)
5472
+ * **Example** (Transforming the error channel)
5473
5473
  *
5474
5474
  * ```ts
5475
5475
  * import { Data, Effect } from "effect"
@@ -5505,7 +5505,7 @@ export const mapError: {
5505
5505
  * @see {@link mapBoth} for a version that operates on both channels.
5506
5506
  * @see {@link mapError} if you want to replace the error with a new one.
5507
5507
  *
5508
- * **Example** (Usage)
5508
+ * **Example** (Transforming the error channel)
5509
5509
  *
5510
5510
  * ```ts
5511
5511
  * import { Data, Effect } from "effect"
@@ -5541,7 +5541,7 @@ export const mapError: {
5541
5541
  * @see {@link mapBoth} for a version that operates on both channels.
5542
5542
  * @see {@link mapError} if you want to replace the error with a new one.
5543
5543
  *
5544
- * **Example** (Usage)
5544
+ * **Example** (Transforming the error channel)
5545
5545
  *
5546
5546
  * ```ts
5547
5547
  * import { Data, Effect } from "effect"
@@ -5576,7 +5576,7 @@ export const mapError: {
5576
5576
  * the error and the success values without altering the overall success or
5577
5577
  * failure status of the effect.
5578
5578
  *
5579
- * **Example** (Usage)
5579
+ * **Example** (Transforming success and failure channels)
5580
5580
  *
5581
5581
  * ```ts
5582
5582
  * import { Data, Effect } from "effect"
@@ -5612,7 +5612,7 @@ export const mapBoth: {
5612
5612
  * the error and the success values without altering the overall success or
5613
5613
  * failure status of the effect.
5614
5614
  *
5615
- * **Example** (Usage)
5615
+ * **Example** (Transforming success and failure channels)
5616
5616
  *
5617
5617
  * ```ts
5618
5618
  * import { Data, Effect } from "effect"
@@ -5650,7 +5650,7 @@ export const mapBoth: {
5650
5650
  * the error and the success values without altering the overall success or
5651
5651
  * failure status of the effect.
5652
5652
  *
5653
- * **Example** (Usage)
5653
+ * **Example** (Transforming success and failure channels)
5654
5654
  *
5655
5655
  * ```ts
5656
5656
  * import { Data, Effect } from "effect"
@@ -5692,7 +5692,7 @@ export const mapBoth: {
5692
5692
  *
5693
5693
  * @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
5694
5694
  *
5695
- * **Example** (Propagating an Error as a Defect)
5695
+ * **Example** (Converting typed failures into defects)
5696
5696
  *
5697
5697
  * ```ts
5698
5698
  * import { Data, Effect } from "effect"
@@ -5729,7 +5729,7 @@ export const orDie: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never, R> = in
5729
5729
  * operation passed to `tapError` fails, that error is also represented in the
5730
5730
  * returned effect's error channel.
5731
5731
  *
5732
- * **Example** (Usage)
5732
+ * **Example** (Running effects on failure)
5733
5733
  *
5734
5734
  * ```ts
5735
5735
  * import { Console, Effect } from "effect"
@@ -5762,7 +5762,7 @@ export const tapError: {
5762
5762
  * operation passed to `tapError` fails, that error is also represented in the
5763
5763
  * returned effect's error channel.
5764
5764
  *
5765
- * **Example** (Usage)
5765
+ * **Example** (Running effects on failure)
5766
5766
  *
5767
5767
  * ```ts
5768
5768
  * import { Console, Effect } from "effect"
@@ -5795,7 +5795,7 @@ export const tapError: {
5795
5795
  * operation passed to `tapError` fails, that error is also represented in the
5796
5796
  * returned effect's error channel.
5797
5797
  *
5798
- * **Example** (Usage)
5798
+ * **Example** (Running effects on failure)
5799
5799
  *
5800
5800
  * ```ts
5801
5801
  * import { Console, Effect } from "effect"
@@ -5827,7 +5827,7 @@ export const tapError: {
5827
5827
  * list of tags. When the handler succeeds, the original failure is preserved;
5828
5828
  * if the handler fails, its error is also included in the returned effect.
5829
5829
  *
5830
- * **Example** (Usage)
5830
+ * **Example** (Running effects for tagged failures)
5831
5831
  *
5832
5832
  * ```ts
5833
5833
  * import { Console, Data, Effect } from "effect"
@@ -5863,7 +5863,7 @@ export const tapErrorTag: {
5863
5863
  * list of tags. When the handler succeeds, the original failure is preserved;
5864
5864
  * if the handler fails, its error is also included in the returned effect.
5865
5865
  *
5866
- * **Example** (Usage)
5866
+ * **Example** (Running effects for tagged failures)
5867
5867
  *
5868
5868
  * ```ts
5869
5869
  * import { Console, Data, Effect } from "effect"
@@ -5902,7 +5902,7 @@ export const tapErrorTag: {
5902
5902
  * list of tags. When the handler succeeds, the original failure is preserved;
5903
5903
  * if the handler fails, its error is also included in the returned effect.
5904
5904
  *
5905
- * **Example** (Usage)
5905
+ * **Example** (Running effects for tagged failures)
5906
5906
  *
5907
5907
  * ```ts
5908
5908
  * import { Console, Data, Effect } from "effect"
@@ -5955,7 +5955,7 @@ export const tapErrorTag: {
5955
5955
  * the operation succeeds, the original cause is preserved. If the operation
5956
5956
  * fails, its error is also represented in the returned effect.
5957
5957
  *
5958
- * **Example** (Usage)
5958
+ * **Example** (Observing full failure causes)
5959
5959
  *
5960
5960
  * ```ts
5961
5961
  * import { Cause, Console, Effect } from "effect"
@@ -5986,7 +5986,7 @@ export const tapCause: {
5986
5986
  * the operation succeeds, the original cause is preserved. If the operation
5987
5987
  * fails, its error is also represented in the returned effect.
5988
5988
  *
5989
- * **Example** (Usage)
5989
+ * **Example** (Observing full failure causes)
5990
5990
  *
5991
5991
  * ```ts
5992
5992
  * import { Cause, Console, Effect } from "effect"
@@ -6017,7 +6017,7 @@ export const tapCause: {
6017
6017
  * the operation succeeds, the original cause is preserved. If the operation
6018
6018
  * fails, its error is also represented in the returned effect.
6019
6019
  *
6020
- * **Example** (Usage)
6020
+ * **Example** (Observing full failure causes)
6021
6021
  *
6022
6022
  * ```ts
6023
6023
  * import { Cause, Console, Effect } from "effect"
@@ -6047,7 +6047,7 @@ export const tapCause: {
6047
6047
  * the cause matches a specific predicate. This is useful for conditional logging,
6048
6048
  * monitoring, or other side effects based on the type of failure.
6049
6049
  *
6050
- * **Example** (Usage)
6050
+ * **Example** (Observing selected failure causes)
6051
6051
  *
6052
6052
  * ```ts
6053
6053
  * import { Cause, Console, Effect } from "effect"
@@ -6077,7 +6077,7 @@ export const tapCauseIf: {
6077
6077
  * the cause matches a specific predicate. This is useful for conditional logging,
6078
6078
  * monitoring, or other side effects based on the type of failure.
6079
6079
  *
6080
- * **Example** (Usage)
6080
+ * **Example** (Observing selected failure causes)
6081
6081
  *
6082
6082
  * ```ts
6083
6083
  * import { Cause, Console, Effect } from "effect"
@@ -6110,7 +6110,7 @@ export const tapCauseIf: {
6110
6110
  * the cause matches a specific predicate. This is useful for conditional logging,
6111
6111
  * monitoring, or other side effects based on the type of failure.
6112
6112
  *
6113
- * **Example** (Usage)
6113
+ * **Example** (Observing selected failure causes)
6114
6114
  *
6115
6115
  * ```ts
6116
6116
  * import { Cause, Console, Effect } from "effect"
@@ -6179,7 +6179,7 @@ export const tapCauseFilter: {
6179
6179
  * operation succeeds, the original defect is preserved; if the operation fails,
6180
6180
  * its error is also represented in the returned effect.
6181
6181
  *
6182
- * **Example** (Usage)
6182
+ * **Example** (Observing defects)
6183
6183
  *
6184
6184
  * ```ts
6185
6185
  * import { Console, Effect } from "effect"
@@ -6227,7 +6227,7 @@ export const tapDefect: {
6227
6227
  * operation succeeds, the original defect is preserved; if the operation fails,
6228
6228
  * its error is also represented in the returned effect.
6229
6229
  *
6230
- * **Example** (Usage)
6230
+ * **Example** (Observing defects)
6231
6231
  *
6232
6232
  * ```ts
6233
6233
  * import { Console, Effect } from "effect"
@@ -6275,7 +6275,7 @@ export const tapDefect: {
6275
6275
  * operation succeeds, the original defect is preserved; if the operation fails,
6276
6276
  * its error is also represented in the returned effect.
6277
6277
  *
6278
- * **Example** (Usage)
6278
+ * **Example** (Observing defects)
6279
6279
  *
6280
6280
  * ```ts
6281
6281
  * import { Console, Effect } from "effect"
@@ -6320,7 +6320,7 @@ export const tapDefect: {
6320
6320
  *
6321
6321
  * Yields between attempts so other fibers can run.
6322
6322
  *
6323
- * **Example** (Usage)
6323
+ * **Example** (Retrying until success)
6324
6324
  *
6325
6325
  * ```ts
6326
6326
  * import { Console, Effect } from "effect"
@@ -6421,7 +6421,7 @@ export declare namespace Retry {
6421
6421
  * Use `retry` when typed failures may be transient, such as network issues or
6422
6422
  * temporary resource unavailability.
6423
6423
  *
6424
- * **Example** (Usage)
6424
+ * **Example** (Retrying with a schedule)
6425
6425
  *
6426
6426
  * ```ts
6427
6427
  * import { Data, Effect, Schedule } from "effect"
@@ -6469,7 +6469,7 @@ export const retry: {
6469
6469
  * Use `retry` when typed failures may be transient, such as network issues or
6470
6470
  * temporary resource unavailability.
6471
6471
  *
6472
- * **Example** (Usage)
6472
+ * **Example** (Retrying with a schedule)
6473
6473
  *
6474
6474
  * ```ts
6475
6475
  * import { Data, Effect, Schedule } from "effect"
@@ -6517,7 +6517,7 @@ export const retry: {
6517
6517
  * Use `retry` when typed failures may be transient, such as network issues or
6518
6518
  * temporary resource unavailability.
6519
6519
  *
6520
- * **Example** (Usage)
6520
+ * **Example** (Retrying with a schedule)
6521
6521
  *
6522
6522
  * ```ts
6523
6523
  * import { Data, Effect, Schedule } from "effect"
@@ -6565,7 +6565,7 @@ export const retry: {
6565
6565
  * Use `retry` when typed failures may be transient, such as network issues or
6566
6566
  * temporary resource unavailability.
6567
6567
  *
6568
- * **Example** (Usage)
6568
+ * **Example** (Retrying with a schedule)
6569
6569
  *
6570
6570
  * ```ts
6571
6571
  * import { Data, Effect, Schedule } from "effect"
@@ -6617,7 +6617,7 @@ export const retry: {
6617
6617
  * Use `retry` when typed failures may be transient, such as network issues or
6618
6618
  * temporary resource unavailability.
6619
6619
  *
6620
- * **Example** (Usage)
6620
+ * **Example** (Retrying with a schedule)
6621
6621
  *
6622
6622
  * ```ts
6623
6623
  * import { Data, Effect, Schedule } from "effect"
@@ -6665,7 +6665,7 @@ export const retry: {
6665
6665
  * Use `retry` when typed failures may be transient, such as network issues or
6666
6666
  * temporary resource unavailability.
6667
6667
  *
6668
- * **Example** (Usage)
6668
+ * **Example** (Retrying with a schedule)
6669
6669
  *
6670
6670
  * ```ts
6671
6671
  * import { Data, Effect, Schedule } from "effect"
@@ -6713,7 +6713,7 @@ export const retry: {
6713
6713
  * Use `retry` when typed failures may be transient, such as network issues or
6714
6714
  * temporary resource unavailability.
6715
6715
  *
6716
- * **Example** (Usage)
6716
+ * **Example** (Retrying with a schedule)
6717
6717
  *
6718
6718
  * ```ts
6719
6719
  * import { Data, Effect, Schedule } from "effect"
@@ -6769,7 +6769,7 @@ export const retry: {
6769
6769
  *
6770
6770
  * @see {@link retry} for a version that does not run a fallback effect.
6771
6771
  *
6772
- * **Example** (Usage)
6772
+ * **Example** (Falling back after retries are exhausted)
6773
6773
  *
6774
6774
  * ```ts
6775
6775
  * import { Console, Data, Effect, Schedule } from "effect"
@@ -6827,7 +6827,7 @@ export const retryOrElse: {
6827
6827
  *
6828
6828
  * @see {@link retry} for a version that does not run a fallback effect.
6829
6829
  *
6830
- * **Example** (Usage)
6830
+ * **Example** (Falling back after retries are exhausted)
6831
6831
  *
6832
6832
  * ```ts
6833
6833
  * import { Console, Data, Effect, Schedule } from "effect"
@@ -6888,7 +6888,7 @@ export const retryOrElse: {
6888
6888
  *
6889
6889
  * @see {@link retry} for a version that does not run a fallback effect.
6890
6890
  *
6891
- * **Example** (Usage)
6891
+ * **Example** (Falling back after retries are exhausted)
6892
6892
  *
6893
6893
  * ```ts
6894
6894
  * import { Console, Data, Effect, Schedule } from "effect"
@@ -6943,7 +6943,7 @@ export const retryOrElse: {
6943
6943
  * failures, defects, and interruptions. Use `unsandbox` to restore the original
6944
6944
  * typed error channel after cause-level handling.
6945
6945
  *
6946
- * **Example** (Usage)
6946
+ * **Example** (Exposing failures as causes)
6947
6947
  *
6948
6948
  * ```ts
6949
6949
  * import { Cause, Effect } from "effect"
@@ -6981,7 +6981,7 @@ export const sandbox: <A, E, R>(
6981
6981
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
6982
6982
  * and `message` to prepend a custom log message.
6983
6983
  *
6984
- * **Example** (Using Effect.ignore to Discard Values)
6984
+ * **Example** (Discarding success and failure values)
6985
6985
  *
6986
6986
  * ```ts
6987
6987
  * import { Effect } from "effect"
@@ -7032,7 +7032,7 @@ export const ignore: <
7032
7032
  * Use the `log` option to emit the full {@link Cause} when the effect fails,
7033
7033
  * and `message` to prepend a custom log message.
7034
7034
  *
7035
- * **Example** (Usage)
7035
+ * **Example** (Ignoring failures and logging causes)
7036
7036
  *
7037
7037
  * ```ts
7038
7038
  * import { Effect } from "effect"
@@ -7071,7 +7071,7 @@ export const ignoreCause: <
7071
7071
  * and retry timing is derived per step (the first attempt uses the remaining
7072
7072
  * attempts schedule; later retries apply the step schedule at least once).
7073
7073
  *
7074
- * **Example** (Usage)
7074
+ * **Example** (Retrying with an execution plan)
7075
7075
  *
7076
7076
  * ```ts
7077
7077
  * import { Context, Effect, ExecutionPlan, Layer } from "effect"
@@ -7106,7 +7106,7 @@ export const withExecutionPlan: {
7106
7106
  * and retry timing is derived per step (the first attempt uses the remaining
7107
7107
  * attempts schedule; later retries apply the step schedule at least once).
7108
7108
  *
7109
- * **Example** (Usage)
7109
+ * **Example** (Retrying with an execution plan)
7110
7110
  *
7111
7111
  * ```ts
7112
7112
  * import { Context, Effect, ExecutionPlan, Layer } from "effect"
@@ -7145,7 +7145,7 @@ export const withExecutionPlan: {
7145
7145
  * and retry timing is derived per step (the first attempt uses the remaining
7146
7146
  * attempts schedule; later retries apply the step schedule at least once).
7147
7147
  *
7148
- * **Example** (Usage)
7148
+ * **Example** (Retrying with an execution plan)
7149
7149
  *
7150
7150
  * ```ts
7151
7151
  * import { Context, Effect, ExecutionPlan, Layer } from "effect"
@@ -7211,7 +7211,7 @@ export const withErrorReporting: <
7211
7211
  *
7212
7212
  * Defects and interruptions are not recovered by this operator.
7213
7213
  *
7214
- * **Example** (Usage)
7214
+ * **Example** (Replacing failures with a value)
7215
7215
  *
7216
7216
  * ```ts
7217
7217
  * import { Effect } from "effect"
@@ -7252,7 +7252,7 @@ export const orElseSucceed: {
7252
7252
  *
7253
7253
  * Defects and interruptions are not recovered by this operator.
7254
7254
  *
7255
- * **Example** (Usage)
7255
+ * **Example** (Replacing failures with a value)
7256
7256
  *
7257
7257
  * ```ts
7258
7258
  * import { Effect } from "effect"
@@ -7293,7 +7293,7 @@ export const orElseSucceed: {
7293
7293
  *
7294
7294
  * Defects and interruptions are not recovered by this operator.
7295
7295
  *
7296
- * **Example** (Usage)
7296
+ * **Example** (Replacing failures with a value)
7297
7297
  *
7298
7298
  * ```ts
7299
7299
  * import { Effect } from "effect"
@@ -7341,7 +7341,7 @@ export const orElseSucceed: {
7341
7341
  * attempting multiple APIs, reading configuration from several sources, or
7342
7342
  * trying alternative resource locations in order.
7343
7343
  *
7344
- * **Example** (Usage)
7344
+ * **Example** (Trying alternatives until one succeeds)
7345
7345
  *
7346
7346
  * ```ts
7347
7347
  * import { Effect } from "effect"
@@ -7385,7 +7385,7 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
7385
7385
  *
7386
7386
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7387
7387
  *
7388
- * **Example** (Usage)
7388
+ * **Example** (Failing when work takes too long)
7389
7389
  *
7390
7390
  * ```ts
7391
7391
  * import { Effect } from "effect"
@@ -7435,7 +7435,7 @@ export const timeout: {
7435
7435
  *
7436
7436
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7437
7437
  *
7438
- * **Example** (Usage)
7438
+ * **Example** (Failing when work takes too long)
7439
7439
  *
7440
7440
  * ```ts
7441
7441
  * import { Effect } from "effect"
@@ -7485,7 +7485,7 @@ export const timeout: {
7485
7485
  *
7486
7486
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7487
7487
  *
7488
- * **Example** (Usage)
7488
+ * **Example** (Failing when work takes too long)
7489
7489
  *
7490
7490
  * ```ts
7491
7491
  * import { Effect } from "effect"
@@ -7535,7 +7535,7 @@ export const timeout: {
7535
7535
  * @see {@link timeout} for a version that raises a `TimeoutException`.
7536
7536
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7537
7537
  *
7538
- * **Example** (Usage)
7538
+ * **Example** (Returning None on timeout)
7539
7539
  *
7540
7540
  * ```ts
7541
7541
  * import { Effect } from "effect"
@@ -7581,7 +7581,7 @@ export const timeoutOption: {
7581
7581
  * @see {@link timeout} for a version that raises a `TimeoutException`.
7582
7582
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7583
7583
  *
7584
- * **Example** (Usage)
7584
+ * **Example** (Returning None on timeout)
7585
7585
  *
7586
7586
  * ```ts
7587
7587
  * import { Effect } from "effect"
@@ -7627,7 +7627,7 @@ export const timeoutOption: {
7627
7627
  * @see {@link timeout} for a version that raises a `TimeoutException`.
7628
7628
  * @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
7629
7629
  *
7630
- * **Example** (Usage)
7630
+ * **Example** (Returning None on timeout)
7631
7631
  *
7632
7632
  * ```ts
7633
7633
  * import { Effect } from "effect"
@@ -7667,7 +7667,7 @@ export const timeoutOption: {
7667
7667
  * This function is useful when you want to set a maximum duration for an operation
7668
7668
  * and provide an alternative action if the timeout is exceeded.
7669
7669
  *
7670
- * **Example** (Usage)
7670
+ * **Example** (Falling back on timeout)
7671
7671
  *
7672
7672
  * ```ts
7673
7673
  * import { Console, Effect } from "effect"
@@ -7705,7 +7705,7 @@ export const timeoutOrElse: {
7705
7705
  * This function is useful when you want to set a maximum duration for an operation
7706
7706
  * and provide an alternative action if the timeout is exceeded.
7707
7707
  *
7708
- * **Example** (Usage)
7708
+ * **Example** (Falling back on timeout)
7709
7709
  *
7710
7710
  * ```ts
7711
7711
  * import { Console, Effect } from "effect"
@@ -7748,7 +7748,7 @@ export const timeoutOrElse: {
7748
7748
  * This function is useful when you want to set a maximum duration for an operation
7749
7749
  * and provide an alternative action if the timeout is exceeded.
7750
7750
  *
7751
- * **Example** (Usage)
7751
+ * **Example** (Falling back on timeout)
7752
7752
  *
7753
7753
  * ```ts
7754
7754
  * import { Console, Effect } from "effect"
@@ -7792,7 +7792,7 @@ export const timeoutOrElse: {
7792
7792
  * Returns an effect that is delayed from this effect by the specified
7793
7793
  * `Duration`.
7794
7794
  *
7795
- * **Example** (Usage)
7795
+ * **Example** (Delaying an effect)
7796
7796
  *
7797
7797
  * ```ts
7798
7798
  * import { Console, Effect } from "effect"
@@ -7814,7 +7814,7 @@ export const delay: {
7814
7814
  * Returns an effect that is delayed from this effect by the specified
7815
7815
  * `Duration`.
7816
7816
  *
7817
- * **Example** (Usage)
7817
+ * **Example** (Delaying an effect)
7818
7818
  *
7819
7819
  * ```ts
7820
7820
  * import { Console, Effect } from "effect"
@@ -7836,7 +7836,7 @@ export const delay: {
7836
7836
  * Returns an effect that is delayed from this effect by the specified
7837
7837
  * `Duration`.
7838
7838
  *
7839
- * **Example** (Usage)
7839
+ * **Example** (Delaying an effect)
7840
7840
  *
7841
7841
  * ```ts
7842
7842
  * import { Console, Effect } from "effect"
@@ -7860,7 +7860,7 @@ export const delay: {
7860
7860
  * Returns an effect that suspends the current fiber for the specified duration
7861
7861
  * without blocking a JavaScript thread.
7862
7862
  *
7863
- * **Example** (Usage)
7863
+ * **Example** (Pausing without blocking)
7864
7864
  *
7865
7865
  * ```ts
7866
7866
  * import { Console, Effect } from "effect"
@@ -7887,7 +7887,7 @@ export const sleep: (duration: Duration.Input) => Effect<void> = internal.sleep
7887
7887
  * The original success, failure, or interruption is preserved; only the success
7888
7888
  * value is paired with the duration.
7889
7889
  *
7890
- * **Example** (Usage)
7890
+ * **Example** (Measuring execution time)
7891
7891
  *
7892
7892
  * ```ts
7893
7893
  * import { Console, Duration, Effect } from "effect"
@@ -7925,7 +7925,7 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
7925
7925
  *
7926
7926
  * @see {@link race} for a version that handles only two effects.
7927
7927
  *
7928
- * **Example** (Usage)
7928
+ * **Example** (Racing many effects)
7929
7929
  *
7930
7930
  * ```ts
7931
7931
  * import { Duration, Effect } from "effect"
@@ -7965,7 +7965,7 @@ export const raceAll: <Eff extends Effect<any, any, any>>(
7965
7965
  * `raceAll` when early failures should be ignored until a success occurs or
7966
7966
  * all effects fail.
7967
7967
  *
7968
- * **Example** (Usage)
7968
+ * **Example** (Taking the first settled result)
7969
7969
  *
7970
7970
  * ```ts
7971
7971
  * import { Duration, Effect } from "effect"
@@ -8001,7 +8001,7 @@ export const raceAllFirst: <Eff extends Effect<any, any, any>>(
8001
8001
  * If one effect succeeds, the other is interrupted and `onWinner` can observe the
8002
8002
  * winning fiber. If both fail, the race fails.
8003
8003
  *
8004
- * **Example** (Usage)
8004
+ * **Example** (Racing two effects)
8005
8005
  *
8006
8006
  * ```ts
8007
8007
  * import { Console, Duration, Effect } from "effect"
@@ -8028,7 +8028,7 @@ export const race: {
8028
8028
  * If one effect succeeds, the other is interrupted and `onWinner` can observe the
8029
8029
  * winning fiber. If both fail, the race fails.
8030
8030
  *
8031
- * **Example** (Usage)
8031
+ * **Example** (Racing two effects)
8032
8032
  *
8033
8033
  * ```ts
8034
8034
  * import { Console, Duration, Effect } from "effect"
@@ -8062,7 +8062,7 @@ export const race: {
8062
8062
  * If one effect succeeds, the other is interrupted and `onWinner` can observe the
8063
8063
  * winning fiber. If both fail, the race fails.
8064
8064
  *
8065
- * **Example** (Usage)
8065
+ * **Example** (Racing two effects)
8066
8066
  *
8067
8067
  * ```ts
8068
8068
  * import { Console, Duration, Effect } from "effect"
@@ -8099,7 +8099,7 @@ export const race: {
8099
8099
  *
8100
8100
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
8101
8101
  *
8102
- * **Example** (Usage)
8102
+ * **Example** (Observing the winning fiber)
8103
8103
  *
8104
8104
  * ```ts
8105
8105
  * import { Console, Duration, Effect } from "effect"
@@ -8129,7 +8129,7 @@ export const raceFirst: {
8129
8129
  *
8130
8130
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
8131
8131
  *
8132
- * **Example** (Usage)
8132
+ * **Example** (Observing the winning fiber)
8133
8133
  *
8134
8134
  * ```ts
8135
8135
  * import { Console, Duration, Effect } from "effect"
@@ -8166,7 +8166,7 @@ export const raceFirst: {
8166
8166
  *
8167
8167
  * The losing effect is interrupted, and `onWinner` can observe the winning fiber.
8168
8168
  *
8169
- * **Example** (Usage)
8169
+ * **Example** (Observing the winning fiber)
8170
8170
  *
8171
8171
  * ```ts
8172
8172
  * import { Console, Duration, Effect } from "effect"
@@ -8208,7 +8208,7 @@ export const raceFirst: {
8208
8208
  * Filters elements of an iterable using a predicate, refinement, or effectful
8209
8209
  * predicate.
8210
8210
  *
8211
- * **Example** (Usage)
8211
+ * **Example** (Filtering success values)
8212
8212
  *
8213
8213
  * ```ts
8214
8214
  * import { Effect } from "effect"
@@ -8234,7 +8234,7 @@ export const filter: {
8234
8234
  * Filters elements of an iterable using a predicate, refinement, or effectful
8235
8235
  * predicate.
8236
8236
  *
8237
- * **Example** (Usage)
8237
+ * **Example** (Filtering success values)
8238
8238
  *
8239
8239
  * ```ts
8240
8240
  * import { Effect } from "effect"
@@ -8260,7 +8260,7 @@ export const filter: {
8260
8260
  * Filters elements of an iterable using a predicate, refinement, or effectful
8261
8261
  * predicate.
8262
8262
  *
8263
- * **Example** (Usage)
8263
+ * **Example** (Filtering success values)
8264
8264
  *
8265
8265
  * ```ts
8266
8266
  * import { Effect } from "effect"
@@ -8286,7 +8286,7 @@ export const filter: {
8286
8286
  * Filters elements of an iterable using a predicate, refinement, or effectful
8287
8287
  * predicate.
8288
8288
  *
8289
- * **Example** (Usage)
8289
+ * **Example** (Filtering success values)
8290
8290
  *
8291
8291
  * ```ts
8292
8292
  * import { Effect } from "effect"
@@ -8315,7 +8315,7 @@ export const filter: {
8315
8315
  * Filters elements of an iterable using a predicate, refinement, or effectful
8316
8316
  * predicate.
8317
8317
  *
8318
- * **Example** (Usage)
8318
+ * **Example** (Filtering success values)
8319
8319
  *
8320
8320
  * ```ts
8321
8321
  * import { Effect } from "effect"
@@ -8341,7 +8341,7 @@ export const filter: {
8341
8341
  * Filters elements of an iterable using a predicate, refinement, or effectful
8342
8342
  * predicate.
8343
8343
  *
8344
- * **Example** (Usage)
8344
+ * **Example** (Filtering success values)
8345
8345
  *
8346
8346
  * ```ts
8347
8347
  * import { Effect } from "effect"
@@ -8367,7 +8367,7 @@ export const filter: {
8367
8367
  * Filters elements of an iterable using a predicate, refinement, or effectful
8368
8368
  * predicate.
8369
8369
  *
8370
- * **Example** (Usage)
8370
+ * **Example** (Filtering success values)
8371
8371
  *
8372
8372
  * ```ts
8373
8373
  * import { Effect } from "effect"
@@ -8454,7 +8454,7 @@ export const filterMapEffect: {
8454
8454
  * `orElse` effect can produce an alternative value or perform additional
8455
8455
  * computations.
8456
8456
  *
8457
- * **Example** (Usage)
8457
+ * **Example** (Filtering with a fallback effect)
8458
8458
  *
8459
8459
  * ```ts
8460
8460
  * import { Effect } from "effect"
@@ -8486,7 +8486,7 @@ export const filterOrElse: {
8486
8486
  * `orElse` effect can produce an alternative value or perform additional
8487
8487
  * computations.
8488
8488
  *
8489
- * **Example** (Usage)
8489
+ * **Example** (Filtering with a fallback effect)
8490
8490
  *
8491
8491
  * ```ts
8492
8492
  * import { Effect } from "effect"
@@ -8521,7 +8521,7 @@ export const filterOrElse: {
8521
8521
  * `orElse` effect can produce an alternative value or perform additional
8522
8522
  * computations.
8523
8523
  *
8524
- * **Example** (Usage)
8524
+ * **Example** (Filtering with a fallback effect)
8525
8525
  *
8526
8526
  * ```ts
8527
8527
  * import { Effect } from "effect"
@@ -8556,7 +8556,7 @@ export const filterOrElse: {
8556
8556
  * `orElse` effect can produce an alternative value or perform additional
8557
8557
  * computations.
8558
8558
  *
8559
- * **Example** (Usage)
8559
+ * **Example** (Filtering with a fallback effect)
8560
8560
  *
8561
8561
  * ```ts
8562
8562
  * import { Effect } from "effect"
@@ -8592,7 +8592,7 @@ export const filterOrElse: {
8592
8592
  * `orElse` effect can produce an alternative value or perform additional
8593
8593
  * computations.
8594
8594
  *
8595
- * **Example** (Usage)
8595
+ * **Example** (Filtering with a fallback effect)
8596
8596
  *
8597
8597
  * ```ts
8598
8598
  * import { Effect } from "effect"
@@ -8659,7 +8659,7 @@ export const filterMapOrElse: {
8659
8659
  * predicate evaluates to `false`, the effect fails with either a custom
8660
8660
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8661
8661
  *
8662
- * **Example** (Usage)
8662
+ * **Example** (Filtering with a custom failure)
8663
8663
  *
8664
8664
  * ```ts
8665
8665
  * import { Effect } from "effect"
@@ -8690,7 +8690,7 @@ export const filterOrFail: {
8690
8690
  * predicate evaluates to `false`, the effect fails with either a custom
8691
8691
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8692
8692
  *
8693
- * **Example** (Usage)
8693
+ * **Example** (Filtering with a custom failure)
8694
8694
  *
8695
8695
  * ```ts
8696
8696
  * import { Effect } from "effect"
@@ -8724,7 +8724,7 @@ export const filterOrFail: {
8724
8724
  * predicate evaluates to `false`, the effect fails with either a custom
8725
8725
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8726
8726
  *
8727
- * **Example** (Usage)
8727
+ * **Example** (Filtering with a custom failure)
8728
8728
  *
8729
8729
  * ```ts
8730
8730
  * import { Effect } from "effect"
@@ -8758,7 +8758,7 @@ export const filterOrFail: {
8758
8758
  * predicate evaluates to `false`, the effect fails with either a custom
8759
8759
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8760
8760
  *
8761
- * **Example** (Usage)
8761
+ * **Example** (Filtering with a custom failure)
8762
8762
  *
8763
8763
  * ```ts
8764
8764
  * import { Effect } from "effect"
@@ -8789,7 +8789,7 @@ export const filterOrFail: {
8789
8789
  * predicate evaluates to `false`, the effect fails with either a custom
8790
8790
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8791
8791
  *
8792
- * **Example** (Usage)
8792
+ * **Example** (Filtering with a custom failure)
8793
8793
  *
8794
8794
  * ```ts
8795
8795
  * import { Effect } from "effect"
@@ -8820,7 +8820,7 @@ export const filterOrFail: {
8820
8820
  * predicate evaluates to `false`, the effect fails with either a custom
8821
8821
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8822
8822
  *
8823
- * **Example** (Usage)
8823
+ * **Example** (Filtering with a custom failure)
8824
8824
  *
8825
8825
  * ```ts
8826
8826
  * import { Effect } from "effect"
@@ -8855,7 +8855,7 @@ export const filterOrFail: {
8855
8855
  * predicate evaluates to `false`, the effect fails with either a custom
8856
8856
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8857
8857
  *
8858
- * **Example** (Usage)
8858
+ * **Example** (Filtering with a custom failure)
8859
8859
  *
8860
8860
  * ```ts
8861
8861
  * import { Effect } from "effect"
@@ -8890,7 +8890,7 @@ export const filterOrFail: {
8890
8890
  * predicate evaluates to `false`, the effect fails with either a custom
8891
8891
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8892
8892
  *
8893
- * **Example** (Usage)
8893
+ * **Example** (Filtering with a custom failure)
8894
8894
  *
8895
8895
  * ```ts
8896
8896
  * import { Effect } from "effect"
@@ -8921,7 +8921,7 @@ export const filterOrFail: {
8921
8921
  * predicate evaluates to `false`, the effect fails with either a custom
8922
8922
  * error (if `orFailWith` is provided) or a `NoSuchElementError`.
8923
8923
  *
8924
- * **Example** (Usage)
8924
+ * **Example** (Filtering with a custom failure)
8925
8925
  *
8926
8926
  * ```ts
8927
8927
  * import { Effect } from "effect"
@@ -9006,7 +9006,7 @@ export const filterMapOrFail: {
9006
9006
  * Use this when an effectful check decides whether to run another effect while
9007
9007
  * representing the skipped case explicitly.
9008
9008
  *
9009
- * **Example** (Usage)
9009
+ * **Example** (Conditionally running an effect)
9010
9010
  *
9011
9011
  * ```ts
9012
9012
  * import { Console, Effect } from "effect"
@@ -9049,7 +9049,7 @@ export const when: {
9049
9049
  * Use this when an effectful check decides whether to run another effect while
9050
9050
  * representing the skipped case explicitly.
9051
9051
  *
9052
- * **Example** (Usage)
9052
+ * **Example** (Conditionally running an effect)
9053
9053
  *
9054
9054
  * ```ts
9055
9055
  * import { Console, Effect } from "effect"
@@ -9092,7 +9092,7 @@ export const when: {
9092
9092
  * Use this when an effectful check decides whether to run another effect while
9093
9093
  * representing the skipped case explicitly.
9094
9094
  *
9095
- * **Example** (Usage)
9095
+ * **Example** (Conditionally running an effect)
9096
9096
  *
9097
9097
  * ```ts
9098
9098
  * import { Console, Effect } from "effect"
@@ -9139,7 +9139,7 @@ export const when: {
9139
9139
  *
9140
9140
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
9141
9141
  *
9142
- * **Example** (Handling Both Success and Failure Cases)
9142
+ * **Example** (Matching success and failure values)
9143
9143
  *
9144
9144
  * ```ts
9145
9145
  * import { Data, Effect } from "effect"
@@ -9197,7 +9197,7 @@ export const match: {
9197
9197
  *
9198
9198
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
9199
9199
  *
9200
- * **Example** (Handling Both Success and Failure Cases)
9200
+ * **Example** (Matching success and failure values)
9201
9201
  *
9202
9202
  * ```ts
9203
9203
  * import { Data, Effect } from "effect"
@@ -9260,7 +9260,7 @@ export const match: {
9260
9260
  *
9261
9261
  * @see {@link matchEffect} if you need to perform side effects in the handlers.
9262
9262
  *
9263
- * **Example** (Handling Both Success and Failure Cases)
9263
+ * **Example** (Matching success and failure values)
9264
9264
  *
9265
9265
  * ```ts
9266
9266
  * import { Data, Effect } from "effect"
@@ -9321,7 +9321,7 @@ export const match: {
9321
9321
  * optimal performance for resolved effects. This is particularly useful in
9322
9322
  * scenarios where you frequently work with already computed values.
9323
9323
  *
9324
- * **Example** (Usage)
9324
+ * **Example** (Pattern matching eagerly when possible)
9325
9325
  *
9326
9326
  * ```ts
9327
9327
  * import { Effect } from "effect"
@@ -9359,7 +9359,7 @@ export const matchEager: {
9359
9359
  * optimal performance for resolved effects. This is particularly useful in
9360
9360
  * scenarios where you frequently work with already computed values.
9361
9361
  *
9362
- * **Example** (Usage)
9362
+ * **Example** (Pattern matching eagerly when possible)
9363
9363
  *
9364
9364
  * ```ts
9365
9365
  * import { Effect } from "effect"
@@ -9402,7 +9402,7 @@ export const matchEager: {
9402
9402
  * optimal performance for resolved effects. This is particularly useful in
9403
9403
  * scenarios where you frequently work with already computed values.
9404
9404
  *
9405
- * **Example** (Usage)
9405
+ * **Example** (Pattern matching eagerly when possible)
9406
9406
  *
9407
9407
  * ```ts
9408
9408
  * import { Effect } from "effect"
@@ -9445,7 +9445,7 @@ export const matchEager: {
9445
9445
  * regular failures, defects, or interruptions. You can provide specific
9446
9446
  * handling logic for each failure type based on the cause.
9447
9447
  *
9448
- * **Example** (Usage)
9448
+ * **Example** (Matching on success or failure causes)
9449
9449
  *
9450
9450
  * ```ts
9451
9451
  * import { Cause, Effect } from "effect"
@@ -9483,7 +9483,7 @@ export const matchCause: {
9483
9483
  * regular failures, defects, or interruptions. You can provide specific
9484
9484
  * handling logic for each failure type based on the cause.
9485
9485
  *
9486
- * **Example** (Usage)
9486
+ * **Example** (Matching on success or failure causes)
9487
9487
  *
9488
9488
  * ```ts
9489
9489
  * import { Cause, Effect } from "effect"
@@ -9526,7 +9526,7 @@ export const matchCause: {
9526
9526
  * regular failures, defects, or interruptions. You can provide specific
9527
9527
  * handling logic for each failure type based on the cause.
9528
9528
  *
9529
- * **Example** (Usage)
9529
+ * **Example** (Matching on success or failure causes)
9530
9530
  *
9531
9531
  * ```ts
9532
9532
  * import { Cause, Effect } from "effect"
@@ -9573,7 +9573,7 @@ export const matchCause: {
9573
9573
  * and you want to avoid the overhead of the effect pipeline. For pending effects,
9574
9574
  * it automatically falls back to the regular `matchCause` behavior.
9575
9575
  *
9576
- * **Example** (Usage)
9576
+ * **Example** (Eagerly matching already completed effects)
9577
9577
  *
9578
9578
  * ```ts
9579
9579
  * import { Effect } from "effect"
@@ -9603,7 +9603,7 @@ export const matchCauseEager: {
9603
9603
  * and you want to avoid the overhead of the effect pipeline. For pending effects,
9604
9604
  * it automatically falls back to the regular `matchCause` behavior.
9605
9605
  *
9606
- * **Example** (Usage)
9606
+ * **Example** (Eagerly matching already completed effects)
9607
9607
  *
9608
9608
  * ```ts
9609
9609
  * import { Effect } from "effect"
@@ -9638,7 +9638,7 @@ export const matchCauseEager: {
9638
9638
  * and you want to avoid the overhead of the effect pipeline. For pending effects,
9639
9639
  * it automatically falls back to the regular `matchCause` behavior.
9640
9640
  *
9641
- * **Example** (Usage)
9641
+ * **Example** (Eagerly matching already completed effects)
9642
9642
  *
9643
9643
  * ```ts
9644
9644
  * import { Effect } from "effect"
@@ -9716,7 +9716,7 @@ export const matchCauseEffectEager: {
9716
9716
  * you to respond accordingly while performing side effects (like logging or
9717
9717
  * other operations).
9718
9718
  *
9719
- * **Example** (Usage)
9719
+ * **Example** (Effectfully matching on causes)
9720
9720
  *
9721
9721
  * ```ts
9722
9722
  * import { Cause, Console, Data, Effect, Result } from "effect"
@@ -9771,7 +9771,7 @@ export const matchCauseEffect: {
9771
9771
  * you to respond accordingly while performing side effects (like logging or
9772
9772
  * other operations).
9773
9773
  *
9774
- * **Example** (Usage)
9774
+ * **Example** (Effectfully matching on causes)
9775
9775
  *
9776
9776
  * ```ts
9777
9777
  * import { Cause, Console, Data, Effect, Result } from "effect"
@@ -9831,7 +9831,7 @@ export const matchCauseEffect: {
9831
9831
  * you to respond accordingly while performing side effects (like logging or
9832
9832
  * other operations).
9833
9833
  *
9834
- * **Example** (Usage)
9834
+ * **Example** (Effectfully matching on causes)
9835
9835
  *
9836
9836
  * ```ts
9837
9837
  * import { Cause, Console, Data, Effect, Result } from "effect"
@@ -9898,7 +9898,7 @@ export const matchCauseEffect: {
9898
9898
  * @see {@link match} if you don't need side effects and only want to handle the
9899
9899
  * result or failure.
9900
9900
  *
9901
- * **Example** (Handling Both Success and Failure Cases with Side Effects)
9901
+ * **Example** (Matching success and failure with effectful handlers)
9902
9902
  *
9903
9903
  * ```ts
9904
9904
  * import { Data, Effect } from "effect"
@@ -9959,7 +9959,7 @@ export const matchEffect: {
9959
9959
  * @see {@link match} if you don't need side effects and only want to handle the
9960
9960
  * result or failure.
9961
9961
  *
9962
- * **Example** (Handling Both Success and Failure Cases with Side Effects)
9962
+ * **Example** (Matching success and failure with effectful handlers)
9963
9963
  *
9964
9964
  * ```ts
9965
9965
  * import { Data, Effect } from "effect"
@@ -10025,7 +10025,7 @@ export const matchEffect: {
10025
10025
  * @see {@link match} if you don't need side effects and only want to handle the
10026
10026
  * result or failure.
10027
10027
  *
10028
- * **Example** (Handling Both Success and Failure Cases with Side Effects)
10028
+ * **Example** (Matching success and failure with effectful handlers)
10029
10029
  *
10030
10030
  * ```ts
10031
10031
  * import { Data, Effect } from "effect"
@@ -10146,7 +10146,7 @@ export const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
10146
10146
  * in the effect's environment. This can be useful for debugging, introspection,
10147
10147
  * or when you need to pass the entire context to another function.
10148
10148
  *
10149
- * **Example** (Usage)
10149
+ * **Example** (Reading the full context)
10150
10150
  *
10151
10151
  * ```ts
10152
10152
  * import { Console, Context, Effect, Option } from "effect"
@@ -10187,7 +10187,7 @@ export const context: <R = never>() => Effect<Context.Context<R>, never, R> = in
10187
10187
  * computations based on all available services. This is useful when you need
10188
10188
  * to conditionally execute logic based on what services are available.
10189
10189
  *
10190
- * **Example** (Usage)
10190
+ * **Example** (Deriving values from the context)
10191
10191
  *
10192
10192
  * ```ts
10193
10193
  * import { Console, Context, Effect, Option } from "effect"
@@ -10234,7 +10234,7 @@ export const contextWith: <R, A, E, R2>(
10234
10234
  * to build the layer every time; by default, layers are shared between provide
10235
10235
  * calls.
10236
10236
  *
10237
- * **Example** (Usage)
10237
+ * **Example** (Providing dependencies with a layer)
10238
10238
  *
10239
10239
  * ```ts
10240
10240
  * import { Context, Effect, Layer } from "effect"
@@ -10269,7 +10269,7 @@ export const provide: {
10269
10269
  * to build the layer every time; by default, layers are shared between provide
10270
10270
  * calls.
10271
10271
  *
10272
- * **Example** (Usage)
10272
+ * **Example** (Providing dependencies with a layer)
10273
10273
  *
10274
10274
  * ```ts
10275
10275
  * import { Context, Effect, Layer } from "effect"
@@ -10315,7 +10315,7 @@ export const provide: {
10315
10315
  * to build the layer every time; by default, layers are shared between provide
10316
10316
  * calls.
10317
10317
  *
10318
- * **Example** (Usage)
10318
+ * **Example** (Providing dependencies with a layer)
10319
10319
  *
10320
10320
  * ```ts
10321
10321
  * import { Context, Effect, Layer } from "effect"
@@ -10357,7 +10357,7 @@ export const provide: {
10357
10357
  * to build the layer every time; by default, layers are shared between provide
10358
10358
  * calls.
10359
10359
  *
10360
- * **Example** (Usage)
10360
+ * **Example** (Providing dependencies with a layer)
10361
10361
  *
10362
10362
  * ```ts
10363
10363
  * import { Context, Effect, Layer } from "effect"
@@ -10392,7 +10392,7 @@ export const provide: {
10392
10392
  * to build the layer every time; by default, layers are shared between provide
10393
10393
  * calls.
10394
10394
  *
10395
- * **Example** (Usage)
10395
+ * **Example** (Providing dependencies with a layer)
10396
10396
  *
10397
10397
  * ```ts
10398
10398
  * import { Context, Effect, Layer } from "effect"
@@ -10437,7 +10437,7 @@ export const provide: {
10437
10437
  * to build the layer every time; by default, layers are shared between provide
10438
10438
  * calls.
10439
10439
  *
10440
- * **Example** (Usage)
10440
+ * **Example** (Providing dependencies with a layer)
10441
10441
  *
10442
10442
  * ```ts
10443
10443
  * import { Context, Effect, Layer } from "effect"
@@ -10478,7 +10478,7 @@ export const provide: {
10478
10478
  * to build the layer every time; by default, layers are shared between provide
10479
10479
  * calls.
10480
10480
  *
10481
- * **Example** (Usage)
10481
+ * **Example** (Providing dependencies with a layer)
10482
10482
  *
10483
10483
  * ```ts
10484
10484
  * import { Context, Effect, Layer } from "effect"
@@ -10519,7 +10519,7 @@ export const provide: {
10519
10519
  * that contains all the required services. It removes the provided services
10520
10520
  * from the effect's requirements, making them available to the effect.
10521
10521
  *
10522
- * **Example** (Usage)
10522
+ * **Example** (Providing a complete context)
10523
10523
  *
10524
10524
  * ```ts
10525
10525
  * import { Context, Effect } from "effect"
@@ -10560,7 +10560,7 @@ export const provideContext: {
10560
10560
  * that contains all the required services. It removes the provided services
10561
10561
  * from the effect's requirements, making them available to the effect.
10562
10562
  *
10563
- * **Example** (Usage)
10563
+ * **Example** (Providing a complete context)
10564
10564
  *
10565
10565
  * ```ts
10566
10566
  * import { Context, Effect } from "effect"
@@ -10601,7 +10601,7 @@ export const provideContext: {
10601
10601
  * that contains all the required services. It removes the provided services
10602
10602
  * from the effect's requirements, making them available to the effect.
10603
10603
  *
10604
- * **Example** (Usage)
10604
+ * **Example** (Providing a complete context)
10605
10605
  *
10606
10606
  * ```ts
10607
10607
  * import { Context, Effect } from "effect"
@@ -10638,7 +10638,7 @@ export const provideContext: {
10638
10638
  /**
10639
10639
  * Accesses a service from the context.
10640
10640
  *
10641
- * **Example** (Usage)
10641
+ * **Example** (Accessing a required service)
10642
10642
  *
10643
10643
  * ```ts
10644
10644
  * import { Context, Effect } from "effect"
@@ -10670,7 +10670,7 @@ export const service: <I, S>(service: Context.Key<I, S>) => Effect<S, never, I>
10670
10670
  * available, it returns `None`. Unlike `service`, this function does not
10671
10671
  * require the service to be present in the environment.
10672
10672
  *
10673
- * **Example** (Usage)
10673
+ * **Example** (Accessing an optional service)
10674
10674
  *
10675
10675
  * ```ts
10676
10676
  * import { Context, Effect, Option } from "effect"
@@ -10705,7 +10705,7 @@ export const serviceOption: <I, S>(key: Context.Key<I, S>) => Effect<Option<S>>
10705
10705
  * This function allows you to transform the context required by an effect,
10706
10706
  * providing part of the context and leaving the rest to be fulfilled later.
10707
10707
  *
10708
- * **Example** (Usage)
10708
+ * **Example** (Updating the context before running)
10709
10709
  *
10710
10710
  * ```ts
10711
10711
  * import { Context, Effect } from "effect"
@@ -10747,7 +10747,7 @@ export const updateContext: {
10747
10747
  * This function allows you to transform the context required by an effect,
10748
10748
  * providing part of the context and leaving the rest to be fulfilled later.
10749
10749
  *
10750
- * **Example** (Usage)
10750
+ * **Example** (Updating the context before running)
10751
10751
  *
10752
10752
  * ```ts
10753
10753
  * import { Context, Effect } from "effect"
@@ -10789,7 +10789,7 @@ export const updateContext: {
10789
10789
  * This function allows you to transform the context required by an effect,
10790
10790
  * providing part of the context and leaving the rest to be fulfilled later.
10791
10791
  *
10792
- * **Example** (Usage)
10792
+ * **Example** (Updating the context before running)
10793
10793
  *
10794
10794
  * ```ts
10795
10795
  * import { Context, Effect } from "effect"
@@ -10835,7 +10835,7 @@ export const updateContext: {
10835
10835
  * The service must be available in the effect's context; `updateService`
10836
10836
  * replaces it for the wrapped effect with the value returned by the updater.
10837
10837
  *
10838
- * **Example** (Usage)
10838
+ * **Example** (Replacing a service for one effect)
10839
10839
  *
10840
10840
  * ```ts
10841
10841
  * import { Console, Context, Effect } from "effect"
@@ -10869,7 +10869,7 @@ export const updateService: {
10869
10869
  * The service must be available in the effect's context; `updateService`
10870
10870
  * replaces it for the wrapped effect with the value returned by the updater.
10871
10871
  *
10872
- * **Example** (Usage)
10872
+ * **Example** (Replacing a service for one effect)
10873
10873
  *
10874
10874
  * ```ts
10875
10875
  * import { Console, Context, Effect } from "effect"
@@ -10903,7 +10903,7 @@ export const updateService: {
10903
10903
  * The service must be available in the effect's context; `updateService`
10904
10904
  * replaces it for the wrapped effect with the value returned by the updater.
10905
10905
  *
10906
- * **Example** (Usage)
10906
+ * **Example** (Replacing a service for one effect)
10907
10907
  *
10908
10908
  * ```ts
10909
10909
  * import { Console, Context, Effect } from "effect"
@@ -10944,7 +10944,7 @@ export const updateService: {
10944
10944
  *
10945
10945
  * @see {@link provide} for providing multiple layers to an effect.
10946
10946
  *
10947
- * **Example** (Usage)
10947
+ * **Example** (Providing a service value)
10948
10948
  *
10949
10949
  * ```ts
10950
10950
  * import { Console, Context, Effect } from "effect"
@@ -10991,7 +10991,7 @@ export const provideService: {
10991
10991
  *
10992
10992
  * @see {@link provide} for providing multiple layers to an effect.
10993
10993
  *
10994
- * **Example** (Usage)
10994
+ * **Example** (Providing a service value)
10995
10995
  *
10996
10996
  * ```ts
10997
10997
  * import { Console, Context, Effect } from "effect"
@@ -11038,7 +11038,7 @@ export const provideService: {
11038
11038
  *
11039
11039
  * @see {@link provide} for providing multiple layers to an effect.
11040
11040
  *
11041
- * **Example** (Usage)
11041
+ * **Example** (Providing a service value)
11042
11042
  *
11043
11043
  * ```ts
11044
11044
  * import { Console, Context, Effect } from "effect"
@@ -11085,7 +11085,7 @@ export const provideService: {
11085
11085
  *
11086
11086
  * @see {@link provide} for providing multiple layers to an effect.
11087
11087
  *
11088
- * **Example** (Usage)
11088
+ * **Example** (Providing a service value)
11089
11089
  *
11090
11090
  * ```ts
11091
11091
  * import { Console, Context, Effect } from "effect"
@@ -11133,7 +11133,7 @@ export const provideService: {
11133
11133
  *
11134
11134
  * @see {@link provide} for providing multiple layers to an effect.
11135
11135
  *
11136
- * **Example** (Usage)
11136
+ * **Example** (Providing a service value)
11137
11137
  *
11138
11138
  * ```ts
11139
11139
  * import { Console, Context, Effect } from "effect"
@@ -11180,7 +11180,7 @@ export const provideService: {
11180
11180
  *
11181
11181
  * @see {@link provide} for providing multiple layers to an effect.
11182
11182
  *
11183
- * **Example** (Usage)
11183
+ * **Example** (Providing a service value)
11184
11184
  *
11185
11185
  * ```ts
11186
11186
  * import { Console, Context, Effect } from "effect"
@@ -11227,7 +11227,7 @@ export const provideService: {
11227
11227
  * and leaves any other requirements to be provided later. Acquisition failures
11228
11228
  * are included in the returned effect's error channel.
11229
11229
  *
11230
- * **Example** (Usage)
11230
+ * **Example** (Providing a service with an effect)
11231
11231
  *
11232
11232
  * ```ts
11233
11233
  * import { Console, Context, Effect } from "effect"
@@ -11281,7 +11281,7 @@ export const provideServiceEffect: {
11281
11281
  * and leaves any other requirements to be provided later. Acquisition failures
11282
11282
  * are included in the returned effect's error channel.
11283
11283
  *
11284
- * **Example** (Usage)
11284
+ * **Example** (Providing a service with an effect)
11285
11285
  *
11286
11286
  * ```ts
11287
11287
  * import { Console, Context, Effect } from "effect"
@@ -11335,7 +11335,7 @@ export const provideServiceEffect: {
11335
11335
  * and leaves any other requirements to be provided later. Acquisition failures
11336
11336
  * are included in the returned effect's error channel.
11337
11337
  *
11338
- * **Example** (Usage)
11338
+ * **Example** (Providing a service with an effect)
11339
11339
  *
11340
11340
  * ```ts
11341
11341
  * import { Console, Context, Effect } from "effect"
@@ -11392,7 +11392,7 @@ export const provideServiceEffect: {
11392
11392
  /**
11393
11393
  * Sets the concurrency level for parallel operations within an effect.
11394
11394
  *
11395
- * **Example** (Usage)
11395
+ * **Example** (Setting local concurrency)
11396
11396
  *
11397
11397
  * ```ts
11398
11398
  * import { Console, Effect } from "effect"
@@ -11429,7 +11429,7 @@ export const withConcurrency: {
11429
11429
  /**
11430
11430
  * Sets the concurrency level for parallel operations within an effect.
11431
11431
  *
11432
- * **Example** (Usage)
11432
+ * **Example** (Setting local concurrency)
11433
11433
  *
11434
11434
  * ```ts
11435
11435
  * import { Console, Effect } from "effect"
@@ -11466,7 +11466,7 @@ export const withConcurrency: {
11466
11466
  /**
11467
11467
  * Sets the concurrency level for parallel operations within an effect.
11468
11468
  *
11469
- * **Example** (Usage)
11469
+ * **Example** (Setting local concurrency)
11470
11470
  *
11471
11471
  * ```ts
11472
11472
  * import { Console, Effect } from "effect"
@@ -11505,7 +11505,7 @@ export const withConcurrency: {
11505
11505
  /**
11506
11506
  * Returns the current scope for resource management.
11507
11507
  *
11508
- * **Example** (Usage)
11508
+ * **Example** (Accessing the current scope)
11509
11509
  *
11510
11510
  * ```ts
11511
11511
  * import { Console, Effect } from "effect"
@@ -11541,7 +11541,7 @@ export const scope: Effect<Scope, never, Scope> = internal.scope
11541
11541
  * ensuring that their finalizers are run as soon as this workflow completes
11542
11542
  * execution, whether by success, failure, or interruption.
11543
11543
  *
11544
- * **Example** (Usage)
11544
+ * **Example** (Running a scoped acquisition)
11545
11545
  *
11546
11546
  * ```ts
11547
11547
  * import { Console, Effect } from "effect"
@@ -11575,7 +11575,7 @@ export const scoped: <A, E, R>(
11575
11575
  /**
11576
11576
  * Creates a scoped effect by providing access to the scope.
11577
11577
  *
11578
- * **Example** (Usage)
11578
+ * **Example** (Working with an explicit scope)
11579
11579
  *
11580
11580
  * ```ts
11581
11581
  * import { Console, Effect, Scope } from "effect"
@@ -11628,7 +11628,7 @@ export const scopedWith: <A, E, R>(
11628
11628
  * By default, acquisition is protected by an uninterruptible region. Pass
11629
11629
  * `{ interruptible: true }` to allow the acquisition effect to be interrupted.
11630
11630
  *
11631
- * **Example** (Usage)
11631
+ * **Example** (Acquiring and releasing a resource)
11632
11632
  *
11633
11633
  * ```ts
11634
11634
  * import { Console, Effect, Exit } from "effect"
@@ -11690,7 +11690,7 @@ export const acquireRelease: <A, E, R, R2>(
11690
11690
  *
11691
11691
  * @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
11692
11692
  *
11693
- * **Example** (Usage)
11693
+ * **Example** (Acquiring a disposable resource)
11694
11694
  *
11695
11695
  * ```ts
11696
11696
  * import sqlite from "node:sqlite";
@@ -11740,7 +11740,7 @@ export const acquireDisposable: <A extends AsyncDisposable | Disposable, E, R>(
11740
11740
  * is not desired, errors produced by the `release` `Effect` value can be caught
11741
11741
  * and ignored.
11742
11742
  *
11743
- * **Example** (Usage)
11743
+ * **Example** (Using a resource with cleanup)
11744
11744
  *
11745
11745
  * ```ts
11746
11746
  * import { Console, Effect, Exit } from "effect"
@@ -11804,7 +11804,7 @@ export const acquireUseRelease: <Resource, E, R, A, E2, R2, E3, R3>(
11804
11804
  * whether the effect succeeds or fails. They're commonly used for resource
11805
11805
  * cleanup, logging, or other side effects that should always occur.
11806
11806
  *
11807
- * **Example** (Usage)
11807
+ * **Example** (Registering scope finalizers)
11808
11808
  *
11809
11809
  * ```ts
11810
11810
  * import { Console, Effect, Exit } from "effect"
@@ -11852,7 +11852,7 @@ export const addFinalizer: <R>(
11852
11852
  * should generally not be used for releasing resources. For higher-level
11853
11853
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
11854
11854
  *
11855
- * **Example** (Usage)
11855
+ * **Example** (Always running cleanup)
11856
11856
  *
11857
11857
  * ```ts
11858
11858
  * import { Console, Effect } from "effect"
@@ -11893,7 +11893,7 @@ export const ensuring: {
11893
11893
  * should generally not be used for releasing resources. For higher-level
11894
11894
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
11895
11895
  *
11896
- * **Example** (Usage)
11896
+ * **Example** (Always running cleanup)
11897
11897
  *
11898
11898
  * ```ts
11899
11899
  * import { Console, Effect } from "effect"
@@ -11934,7 +11934,7 @@ export const ensuring: {
11934
11934
  * should generally not be used for releasing resources. For higher-level
11935
11935
  * logic built on `ensuring`, see the `acquireRelease` family of methods.
11936
11936
  *
11937
- * **Example** (Usage)
11937
+ * **Example** (Always running cleanup)
11938
11938
  *
11939
11939
  * ```ts
11940
11940
  * import { Console, Effect } from "effect"
@@ -11970,7 +11970,7 @@ export const ensuring: {
11970
11970
  * Runs the specified effect if this effect fails, providing the error to the
11971
11971
  * effect if it exists. The provided effect will not be interrupted.
11972
11972
  *
11973
- * **Example** (Usage)
11973
+ * **Example** (Running cleanup on failure)
11974
11974
  *
11975
11975
  * ```ts
11976
11976
  * import { Cause, Console, Data, Effect } from "effect"
@@ -11998,7 +11998,7 @@ export const onError: {
11998
11998
  * Runs the specified effect if this effect fails, providing the error to the
11999
11999
  * effect if it exists. The provided effect will not be interrupted.
12000
12000
  *
12001
- * **Example** (Usage)
12001
+ * **Example** (Running cleanup on failure)
12002
12002
  *
12003
12003
  * ```ts
12004
12004
  * import { Cause, Console, Data, Effect } from "effect"
@@ -12026,7 +12026,7 @@ export const onError: {
12026
12026
  * Runs the specified effect if this effect fails, providing the error to the
12027
12027
  * effect if it exists. The provided effect will not be interrupted.
12028
12028
  *
12029
- * **Example** (Usage)
12029
+ * **Example** (Running cleanup on failure)
12030
12030
  *
12031
12031
  * ```ts
12032
12032
  * import { Cause, Console, Data, Effect } from "effect"
@@ -12059,7 +12059,7 @@ export const onError: {
12059
12059
  * Runs the finalizer only when this effect fails and the `Cause` matches the
12060
12060
  * provided predicate.
12061
12061
  *
12062
- * **Example** (Usage)
12062
+ * **Example** (Running cleanup for selected failures)
12063
12063
  *
12064
12064
  * ```ts
12065
12065
  * import { Cause, Console, Effect } from "effect"
@@ -12084,7 +12084,7 @@ export const onErrorIf: {
12084
12084
  * Runs the finalizer only when this effect fails and the `Cause` matches the
12085
12085
  * provided predicate.
12086
12086
  *
12087
- * **Example** (Usage)
12087
+ * **Example** (Running cleanup for selected failures)
12088
12088
  *
12089
12089
  * ```ts
12090
12090
  * import { Cause, Console, Effect } from "effect"
@@ -12112,7 +12112,7 @@ export const onErrorIf: {
12112
12112
  * Runs the finalizer only when this effect fails and the `Cause` matches the
12113
12113
  * provided predicate.
12114
12114
  *
12115
- * **Example** (Usage)
12115
+ * **Example** (Running cleanup for selected failures)
12116
12116
  *
12117
12117
  * ```ts
12118
12118
  * import { Cause, Console, Effect } from "effect"
@@ -12191,7 +12191,7 @@ export const onExitPrimitive: <A, E, R, XE = never, XR = never>(
12191
12191
  * Ensures that a cleanup functions runs, whether this effect succeeds, fails,
12192
12192
  * or is interrupted.
12193
12193
  *
12194
- * **Example** (Usage)
12194
+ * **Example** (Observing every exit)
12195
12195
  *
12196
12196
  * ```ts
12197
12197
  * import { Console, Effect, Exit } from "effect"
@@ -12219,7 +12219,7 @@ export const onExit: {
12219
12219
  * Ensures that a cleanup functions runs, whether this effect succeeds, fails,
12220
12220
  * or is interrupted.
12221
12221
  *
12222
- * **Example** (Usage)
12222
+ * **Example** (Observing every exit)
12223
12223
  *
12224
12224
  * ```ts
12225
12225
  * import { Console, Effect, Exit } from "effect"
@@ -12247,7 +12247,7 @@ export const onExit: {
12247
12247
  * Ensures that a cleanup functions runs, whether this effect succeeds, fails,
12248
12248
  * or is interrupted.
12249
12249
  *
12250
- * **Example** (Usage)
12250
+ * **Example** (Observing every exit)
12251
12251
  *
12252
12252
  * ```ts
12253
12253
  * import { Console, Effect, Exit } from "effect"
@@ -12277,7 +12277,7 @@ export const onExit: {
12277
12277
  * Runs the cleanup effect only when the `Exit` satisfies the provided
12278
12278
  * predicate.
12279
12279
  *
12280
- * **Example** (Usage)
12280
+ * **Example** (Observing selected exits)
12281
12281
  *
12282
12282
  * ```ts
12283
12283
  * import { Console, Effect, Exit } from "effect"
@@ -12300,7 +12300,7 @@ export const onExitIf: {
12300
12300
  * Runs the cleanup effect only when the `Exit` satisfies the provided
12301
12301
  * predicate.
12302
12302
  *
12303
- * **Example** (Usage)
12303
+ * **Example** (Observing selected exits)
12304
12304
  *
12305
12305
  * ```ts
12306
12306
  * import { Console, Effect, Exit } from "effect"
@@ -12326,7 +12326,7 @@ export const onExitIf: {
12326
12326
  * Runs the cleanup effect only when the `Exit` satisfies the provided
12327
12327
  * predicate.
12328
12328
  *
12329
- * **Example** (Usage)
12329
+ * **Example** (Observing selected exits)
12330
12330
  *
12331
12331
  * ```ts
12332
12332
  * import { Console, Effect, Exit } from "effect"
@@ -12408,7 +12408,7 @@ export const onExitFilter: {
12408
12408
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
12409
12409
  * additional effect for manually invalidating the cached value.
12410
12410
  *
12411
- * **Example** (Usage)
12411
+ * **Example** (Memoizing an effect until invalidated)
12412
12412
  *
12413
12413
  * ```ts
12414
12414
  * import { Console, Effect } from "effect"
@@ -12483,7 +12483,7 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
12483
12483
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
12484
12484
  * additional effect for manually invalidating the cached value.
12485
12485
  *
12486
- * **Example** (Usage)
12486
+ * **Example** (Memoizing an effect with TTL)
12487
12487
  *
12488
12488
  * ```ts
12489
12489
  * import { Console, Effect } from "effect"
@@ -12551,7 +12551,7 @@ export const cachedWithTTL: {
12551
12551
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
12552
12552
  * additional effect for manually invalidating the cached value.
12553
12553
  *
12554
- * **Example** (Usage)
12554
+ * **Example** (Memoizing an effect with TTL)
12555
12555
  *
12556
12556
  * ```ts
12557
12557
  * import { Console, Effect } from "effect"
@@ -12619,7 +12619,7 @@ export const cachedWithTTL: {
12619
12619
  * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
12620
12620
  * additional effect for manually invalidating the cached value.
12621
12621
  *
12622
- * **Example** (Usage)
12622
+ * **Example** (Memoizing an effect with TTL)
12623
12623
  *
12624
12624
  * ```ts
12625
12625
  * import { Console, Effect } from "effect"
@@ -12689,7 +12689,7 @@ export const cachedWithTTL: {
12689
12689
  * @see {@link cachedWithTTL} for a similar function that caches the result for
12690
12690
  * a specified duration but does not include an effect for manual invalidation.
12691
12691
  *
12692
- * **Example** (Usage)
12692
+ * **Example** (Memoizing with TTL and invalidation)
12693
12693
  *
12694
12694
  * ```ts
12695
12695
  * import { Console, Effect } from "effect"
@@ -12760,7 +12760,7 @@ export const cachedInvalidateWithTTL: {
12760
12760
  * @see {@link cachedWithTTL} for a similar function that caches the result for
12761
12761
  * a specified duration but does not include an effect for manual invalidation.
12762
12762
  *
12763
- * **Example** (Usage)
12763
+ * **Example** (Memoizing with TTL and invalidation)
12764
12764
  *
12765
12765
  * ```ts
12766
12766
  * import { Console, Effect } from "effect"
@@ -12831,7 +12831,7 @@ export const cachedInvalidateWithTTL: {
12831
12831
  * @see {@link cachedWithTTL} for a similar function that caches the result for
12832
12832
  * a specified duration but does not include an effect for manual invalidation.
12833
12833
  *
12834
- * **Example** (Usage)
12834
+ * **Example** (Memoizing with TTL and invalidation)
12835
12835
  *
12836
12836
  * ```ts
12837
12837
  * import { Console, Effect } from "effect"
@@ -12879,7 +12879,7 @@ export const cachedInvalidateWithTTL: {
12879
12879
  /**
12880
12880
  * Returns an effect that is immediately interrupted.
12881
12881
  *
12882
- * **Example** (Usage)
12882
+ * **Example** (Creating an interrupted effect)
12883
12883
  *
12884
12884
  * ```ts
12885
12885
  * import { Effect } from "effect"
@@ -12901,7 +12901,7 @@ export const interrupt: Effect<never> = internal.interrupt
12901
12901
  /**
12902
12902
  * Returns a new effect that allows the effect to be interruptible.
12903
12903
  *
12904
- * **Example** (Usage)
12904
+ * **Example** (Allowing interruption)
12905
12905
  *
12906
12906
  * ```ts
12907
12907
  * import { Effect } from "effect"
@@ -12925,7 +12925,7 @@ export const interruptible: <A, E, R>(
12925
12925
  /**
12926
12926
  * Runs the specified finalizer effect if this effect is interrupted.
12927
12927
  *
12928
- * **Example** (Usage)
12928
+ * **Example** (Running cleanup on interruption)
12929
12929
  *
12930
12930
  * ```ts
12931
12931
  * import { Console, Effect, Fiber } from "effect"
@@ -12950,7 +12950,7 @@ export const onInterrupt: {
12950
12950
  /**
12951
12951
  * Runs the specified finalizer effect if this effect is interrupted.
12952
12952
  *
12953
- * **Example** (Usage)
12953
+ * **Example** (Running cleanup on interruption)
12954
12954
  *
12955
12955
  * ```ts
12956
12956
  * import { Console, Effect, Fiber } from "effect"
@@ -12975,7 +12975,7 @@ export const onInterrupt: {
12975
12975
  /**
12976
12976
  * Runs the specified finalizer effect if this effect is interrupted.
12977
12977
  *
12978
- * **Example** (Usage)
12978
+ * **Example** (Running cleanup on interruption)
12979
12979
  *
12980
12980
  * ```ts
12981
12981
  * import { Console, Effect, Fiber } from "effect"
@@ -13005,7 +13005,7 @@ export const onInterrupt: {
13005
13005
  /**
13006
13006
  * Returns a new effect that disables interruption for the given effect.
13007
13007
  *
13008
- * **Example** (Usage)
13008
+ * **Example** (Preventing interruption)
13009
13009
  *
13010
13010
  * ```ts
13011
13011
  * import { Console, Effect, Fiber } from "effect"
@@ -13034,7 +13034,7 @@ export const uninterruptible: <A, E, R>(
13034
13034
  * Disables interruption and provides a restore function to restore the
13035
13035
  * interruptible state within the effect.
13036
13036
  *
13037
- * **Example** (Usage)
13037
+ * **Example** (Restoring interruption in protected regions)
13038
13038
  *
13039
13039
  * ```ts
13040
13040
  * import { Console, Effect } from "effect"
@@ -13071,7 +13071,7 @@ export const uninterruptibleMask: <A, E, R>(
13071
13071
  * `restore` function. This function can be used to restore the interruptibility
13072
13072
  * of any specific region of code.
13073
13073
  *
13074
- * **Example** (Usage)
13074
+ * **Example** (Controlling interruptibility locally)
13075
13075
  *
13076
13076
  * ```ts
13077
13077
  * import { Console, Effect } from "effect"
@@ -13169,7 +13169,7 @@ export declare namespace Repeat {
13169
13169
  /**
13170
13170
  * Repeats this effect forever (until the first error).
13171
13171
  *
13172
- * **Example** (Usage)
13172
+ * **Example** (Repeating forever)
13173
13173
  *
13174
13174
  * ```ts
13175
13175
  * import { Console, Effect, Fiber } from "effect"
@@ -13232,7 +13232,7 @@ export const forever: <
13232
13232
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13233
13233
  * each execution.
13234
13234
  *
13235
- * **Example** (Usage)
13235
+ * **Example** (Repeating successful effects with a schedule)
13236
13236
  *
13237
13237
  * ```ts
13238
13238
  * // Success Example
@@ -13245,7 +13245,7 @@ export const forever: <
13245
13245
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13246
13246
  * ```
13247
13247
  *
13248
- * **Example** (Usage)
13248
+ * **Example** (Stopping repetition on failure)
13249
13249
  *
13250
13250
  * ```ts
13251
13251
  * // Failure Example
@@ -13297,7 +13297,7 @@ export const repeat: {
13297
13297
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13298
13298
  * each execution.
13299
13299
  *
13300
- * **Example** (Usage)
13300
+ * **Example** (Repeating successful effects with a schedule)
13301
13301
  *
13302
13302
  * ```ts
13303
13303
  * // Success Example
@@ -13310,7 +13310,7 @@ export const repeat: {
13310
13310
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13311
13311
  * ```
13312
13312
  *
13313
- * **Example** (Usage)
13313
+ * **Example** (Stopping repetition on failure)
13314
13314
  *
13315
13315
  * ```ts
13316
13316
  * // Failure Example
@@ -13362,7 +13362,7 @@ export const repeat: {
13362
13362
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13363
13363
  * each execution.
13364
13364
  *
13365
- * **Example** (Usage)
13365
+ * **Example** (Repeating successful effects with a schedule)
13366
13366
  *
13367
13367
  * ```ts
13368
13368
  * // Success Example
@@ -13375,7 +13375,7 @@ export const repeat: {
13375
13375
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13376
13376
  * ```
13377
13377
  *
13378
- * **Example** (Usage)
13378
+ * **Example** (Stopping repetition on failure)
13379
13379
  *
13380
13380
  * ```ts
13381
13381
  * // Failure Example
@@ -13427,7 +13427,7 @@ export const repeat: {
13427
13427
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13428
13428
  * each execution.
13429
13429
  *
13430
- * **Example** (Usage)
13430
+ * **Example** (Repeating successful effects with a schedule)
13431
13431
  *
13432
13432
  * ```ts
13433
13433
  * // Success Example
@@ -13440,7 +13440,7 @@ export const repeat: {
13440
13440
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13441
13441
  * ```
13442
13442
  *
13443
- * **Example** (Usage)
13443
+ * **Example** (Stopping repetition on failure)
13444
13444
  *
13445
13445
  * ```ts
13446
13446
  * // Failure Example
@@ -13496,7 +13496,7 @@ export const repeat: {
13496
13496
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13497
13497
  * each execution.
13498
13498
  *
13499
- * **Example** (Usage)
13499
+ * **Example** (Repeating successful effects with a schedule)
13500
13500
  *
13501
13501
  * ```ts
13502
13502
  * // Success Example
@@ -13509,7 +13509,7 @@ export const repeat: {
13509
13509
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13510
13510
  * ```
13511
13511
  *
13512
- * **Example** (Usage)
13512
+ * **Example** (Stopping repetition on failure)
13513
13513
  *
13514
13514
  * ```ts
13515
13515
  * // Failure Example
@@ -13561,7 +13561,7 @@ export const repeat: {
13561
13561
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13562
13562
  * each execution.
13563
13563
  *
13564
- * **Example** (Usage)
13564
+ * **Example** (Repeating successful effects with a schedule)
13565
13565
  *
13566
13566
  * ```ts
13567
13567
  * // Success Example
@@ -13574,7 +13574,7 @@ export const repeat: {
13574
13574
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13575
13575
  * ```
13576
13576
  *
13577
- * **Example** (Usage)
13577
+ * **Example** (Stopping repetition on failure)
13578
13578
  *
13579
13579
  * ```ts
13580
13580
  * // Failure Example
@@ -13629,7 +13629,7 @@ export const repeat: {
13629
13629
  * delays, limiting recursions, or dynamically adjusting based on the outcome of
13630
13630
  * each execution.
13631
13631
  *
13632
- * **Example** (Usage)
13632
+ * **Example** (Repeating successful effects with a schedule)
13633
13633
  *
13634
13634
  * ```ts
13635
13635
  * // Success Example
@@ -13642,7 +13642,7 @@ export const repeat: {
13642
13642
  * // Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))
13643
13643
  * ```
13644
13644
  *
13645
- * **Example** (Usage)
13645
+ * **Example** (Stopping repetition on failure)
13646
13646
  *
13647
13647
  * ```ts
13648
13648
  * // Failure Example
@@ -13690,7 +13690,7 @@ export const repeat: {
13690
13690
  * otherwise it receives `None`. If the schedule completes normally, the
13691
13691
  * returned effect succeeds with the schedule's output.
13692
13692
  *
13693
- * **Example** (Usage)
13693
+ * **Example** (Recovering after repetition stops)
13694
13694
  *
13695
13695
  * ```ts
13696
13696
  * import { Console, Effect, Option, Schedule } from "effect"
@@ -13733,7 +13733,7 @@ export const repeatOrElse: {
13733
13733
  * otherwise it receives `None`. If the schedule completes normally, the
13734
13734
  * returned effect succeeds with the schedule's output.
13735
13735
  *
13736
- * **Example** (Usage)
13736
+ * **Example** (Recovering after repetition stops)
13737
13737
  *
13738
13738
  * ```ts
13739
13739
  * import { Console, Effect, Option, Schedule } from "effect"
@@ -13779,7 +13779,7 @@ export const repeatOrElse: {
13779
13779
  * otherwise it receives `None`. If the schedule completes normally, the
13780
13780
  * returned effect succeeds with the schedule's output.
13781
13781
  *
13782
- * **Example** (Usage)
13782
+ * **Example** (Recovering after repetition stops)
13783
13783
  *
13784
13784
  * ```ts
13785
13785
  * import { Console, Effect, Option, Schedule } from "effect"
@@ -13851,7 +13851,7 @@ export const replicate: {
13851
13851
  *
13852
13852
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
13853
13853
  *
13854
- * **Example** (Usage)
13854
+ * **Example** (Replicating an effect)
13855
13855
  *
13856
13856
  * ```ts
13857
13857
  * import { Console, Effect } from "effect"
@@ -13871,7 +13871,7 @@ export const replicateEffect: {
13871
13871
  *
13872
13872
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
13873
13873
  *
13874
- * **Example** (Usage)
13874
+ * **Example** (Replicating an effect)
13875
13875
  *
13876
13876
  * ```ts
13877
13877
  * import { Console, Effect } from "effect"
@@ -13894,7 +13894,7 @@ export const replicateEffect: {
13894
13894
  *
13895
13895
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
13896
13896
  *
13897
- * **Example** (Usage)
13897
+ * **Example** (Replicating an effect)
13898
13898
  *
13899
13899
  * ```ts
13900
13900
  * import { Console, Effect } from "effect"
@@ -13917,7 +13917,7 @@ export const replicateEffect: {
13917
13917
  *
13918
13918
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
13919
13919
  *
13920
- * **Example** (Usage)
13920
+ * **Example** (Replicating an effect)
13921
13921
  *
13922
13922
  * ```ts
13923
13923
  * import { Console, Effect } from "effect"
@@ -13941,7 +13941,7 @@ export const replicateEffect: {
13941
13941
  *
13942
13942
  * Use `concurrency` to control parallelism and `discard: true` to ignore results.
13943
13943
  *
13944
- * **Example** (Usage)
13944
+ * **Example** (Replicating an effect)
13945
13945
  *
13946
13946
  * ```ts
13947
13947
  * import { Console, Effect } from "effect"
@@ -13974,7 +13974,7 @@ export const replicateEffect: {
13974
13974
  * fails, and otherwise succeeds with the schedule output when the schedule
13975
13975
  * completes.
13976
13976
  *
13977
- * **Example** (Usage)
13977
+ * **Example** (Scheduling repeated execution)
13978
13978
  *
13979
13979
  * ```ts
13980
13980
  * import { Console, Effect, Schedule } from "effect"
@@ -14017,7 +14017,7 @@ export const schedule: {
14017
14017
  * fails, and otherwise succeeds with the schedule output when the schedule
14018
14018
  * completes.
14019
14019
  *
14020
- * **Example** (Usage)
14020
+ * **Example** (Scheduling repeated execution)
14021
14021
  *
14022
14022
  * ```ts
14023
14023
  * import { Console, Effect, Schedule } from "effect"
@@ -14060,7 +14060,7 @@ export const schedule: {
14060
14060
  * fails, and otherwise succeeds with the schedule output when the schedule
14061
14061
  * completes.
14062
14062
  *
14063
- * **Example** (Usage)
14063
+ * **Example** (Scheduling repeated execution)
14064
14064
  *
14065
14065
  * ```ts
14066
14066
  * import { Console, Effect, Schedule } from "effect"
@@ -14108,7 +14108,7 @@ export const schedule: {
14108
14108
  * succeeds with the schedule output when the schedule completes and fails if
14109
14109
  * the effect or schedule fails.
14110
14110
  *
14111
- * **Example** (Usage)
14111
+ * **Example** (Scheduling from an initial value)
14112
14112
  *
14113
14113
  * ```ts
14114
14114
  * import { Console, Effect, Schedule } from "effect"
@@ -14146,7 +14146,7 @@ export const scheduleFrom: {
14146
14146
  * succeeds with the schedule output when the schedule completes and fails if
14147
14147
  * the effect or schedule fails.
14148
14148
  *
14149
- * **Example** (Usage)
14149
+ * **Example** (Scheduling from an initial value)
14150
14150
  *
14151
14151
  * ```ts
14152
14152
  * import { Console, Effect, Schedule } from "effect"
@@ -14184,7 +14184,7 @@ export const scheduleFrom: {
14184
14184
  * succeeds with the schedule output when the schedule completes and fails if
14185
14185
  * the effect or schedule fails.
14186
14186
  *
14187
- * **Example** (Usage)
14187
+ * **Example** (Scheduling from an initial value)
14188
14188
  *
14189
14189
  * ```ts
14190
14190
  * import { Console, Effect, Schedule } from "effect"
@@ -14223,7 +14223,7 @@ export const scheduleFrom: {
14223
14223
  /**
14224
14224
  * Returns the current tracer from the context.
14225
14225
  *
14226
- * **Example** (Usage)
14226
+ * **Example** (Accessing the current tracer)
14227
14227
  *
14228
14228
  * ```ts
14229
14229
  * import { Effect } from "effect"
@@ -14243,7 +14243,7 @@ export const tracer: Effect<Tracer> = internal.tracer
14243
14243
  /**
14244
14244
  * Provides a tracer to an effect.
14245
14245
  *
14246
- * **Example** (Usage)
14246
+ * **Example** (Providing a tracer)
14247
14247
  *
14248
14248
  * ```ts
14249
14249
  * import { Effect } from "effect"
@@ -14264,7 +14264,7 @@ export const withTracer: {
14264
14264
  /**
14265
14265
  * Provides a tracer to an effect.
14266
14266
  *
14267
- * **Example** (Usage)
14267
+ * **Example** (Providing a tracer)
14268
14268
  *
14269
14269
  * ```ts
14270
14270
  * import { Effect } from "effect"
@@ -14285,7 +14285,7 @@ export const withTracer: {
14285
14285
  /**
14286
14286
  * Provides a tracer to an effect.
14287
14287
  *
14288
- * **Example** (Usage)
14288
+ * **Example** (Providing a tracer)
14289
14289
  *
14290
14290
  * ```ts
14291
14291
  * import { Effect } from "effect"
@@ -14313,7 +14313,7 @@ export const withTracer: {
14313
14313
  * When `enabled` is `false`, spans created inside the effect are not registered
14314
14314
  * with the current tracer and do not propagate as normal trace parents.
14315
14315
  *
14316
- * **Example** (Usage)
14316
+ * **Example** (Enabling or disabling tracing)
14317
14317
  *
14318
14318
  * ```ts
14319
14319
  * import { Effect } from "effect"
@@ -14337,7 +14337,7 @@ export const withTracerEnabled: {
14337
14337
  * When `enabled` is `false`, spans created inside the effect are not registered
14338
14338
  * with the current tracer and do not propagate as normal trace parents.
14339
14339
  *
14340
- * **Example** (Usage)
14340
+ * **Example** (Enabling or disabling tracing)
14341
14341
  *
14342
14342
  * ```ts
14343
14343
  * import { Effect } from "effect"
@@ -14361,7 +14361,7 @@ export const withTracerEnabled: {
14361
14361
  * When `enabled` is `false`, spans created inside the effect are not registered
14362
14362
  * with the current tracer and do not propagate as normal trace parents.
14363
14363
  *
14364
- * **Example** (Usage)
14364
+ * **Example** (Enabling or disabling tracing)
14365
14365
  *
14366
14366
  * ```ts
14367
14367
  * import { Effect } from "effect"
@@ -14382,7 +14382,7 @@ export const withTracerEnabled: {
14382
14382
  /**
14383
14383
  * Enables or disables tracer timing for the given Effect.
14384
14384
  *
14385
- * **Example** (Usage)
14385
+ * **Example** (Enabling or disabling tracing timing)
14386
14386
  *
14387
14387
  * ```ts
14388
14388
  * import { Effect } from "effect"
@@ -14401,7 +14401,7 @@ export const withTracerTiming: {
14401
14401
  /**
14402
14402
  * Enables or disables tracer timing for the given Effect.
14403
14403
  *
14404
- * **Example** (Usage)
14404
+ * **Example** (Enabling or disabling tracing timing)
14405
14405
  *
14406
14406
  * ```ts
14407
14407
  * import { Effect } from "effect"
@@ -14420,7 +14420,7 @@ export const withTracerTiming: {
14420
14420
  /**
14421
14421
  * Enables or disables tracer timing for the given Effect.
14422
14422
  *
14423
- * **Example** (Usage)
14423
+ * **Example** (Enabling or disabling tracing timing)
14424
14424
  *
14425
14425
  * ```ts
14426
14426
  * import { Effect } from "effect"
@@ -14441,7 +14441,7 @@ export const withTracerTiming: {
14441
14441
  /**
14442
14442
  * Adds an annotation to each span in this effect.
14443
14443
  *
14444
- * **Example** (Usage)
14444
+ * **Example** (Annotating all spans)
14445
14445
  *
14446
14446
  * ```ts
14447
14447
  * import { Effect } from "effect"
@@ -14469,7 +14469,7 @@ export const annotateSpans: {
14469
14469
  /**
14470
14470
  * Adds an annotation to each span in this effect.
14471
14471
  *
14472
- * **Example** (Usage)
14472
+ * **Example** (Annotating all spans)
14473
14473
  *
14474
14474
  * ```ts
14475
14475
  * import { Effect } from "effect"
@@ -14497,7 +14497,7 @@ export const annotateSpans: {
14497
14497
  /**
14498
14498
  * Adds an annotation to each span in this effect.
14499
14499
  *
14500
- * **Example** (Usage)
14500
+ * **Example** (Annotating all spans)
14501
14501
  *
14502
14502
  * ```ts
14503
14503
  * import { Effect } from "effect"
@@ -14525,7 +14525,7 @@ export const annotateSpans: {
14525
14525
  /**
14526
14526
  * Adds an annotation to each span in this effect.
14527
14527
  *
14528
- * **Example** (Usage)
14528
+ * **Example** (Annotating all spans)
14529
14529
  *
14530
14530
  * ```ts
14531
14531
  * import { Effect } from "effect"
@@ -14553,7 +14553,7 @@ export const annotateSpans: {
14553
14553
  /**
14554
14554
  * Adds an annotation to each span in this effect.
14555
14555
  *
14556
- * **Example** (Usage)
14556
+ * **Example** (Annotating all spans)
14557
14557
  *
14558
14558
  * ```ts
14559
14559
  * import { Effect } from "effect"
@@ -14583,7 +14583,7 @@ export const annotateSpans: {
14583
14583
  /**
14584
14584
  * Adds an annotation to the current span if available.
14585
14585
  *
14586
- * **Example** (Usage)
14586
+ * **Example** (Annotating the current span)
14587
14587
  *
14588
14588
  * ```ts
14589
14589
  * import { Effect } from "effect"
@@ -14608,7 +14608,7 @@ export const annotateCurrentSpan: {
14608
14608
  /**
14609
14609
  * Adds an annotation to the current span if available.
14610
14610
  *
14611
- * **Example** (Usage)
14611
+ * **Example** (Annotating the current span)
14612
14612
  *
14613
14613
  * ```ts
14614
14614
  * import { Effect } from "effect"
@@ -14633,7 +14633,7 @@ export const annotateCurrentSpan: {
14633
14633
  /**
14634
14634
  * Adds an annotation to the current span if available.
14635
14635
  *
14636
- * **Example** (Usage)
14636
+ * **Example** (Annotating the current span)
14637
14637
  *
14638
14638
  * ```ts
14639
14639
  * import { Effect } from "effect"
@@ -14665,7 +14665,7 @@ export const annotateCurrentSpan: {
14665
14665
  * The effect fails with `NoSuchElementError` when there is no active local
14666
14666
  * `Span`.
14667
14667
  *
14668
- * **Example** (Usage)
14668
+ * **Example** (Reading the current span)
14669
14669
  *
14670
14670
  * ```ts
14671
14671
  * import { Effect } from "effect"
@@ -14693,7 +14693,7 @@ export const currentSpan: Effect<Span, Cause.NoSuchElementError> = internal.curr
14693
14693
  * present, and fails with `NoSuchElementError` when no parent span is
14694
14694
  * available.
14695
14695
  *
14696
- * **Example** (Usage)
14696
+ * **Example** (Reading the parent span)
14697
14697
  *
14698
14698
  * ```ts
14699
14699
  * import { Effect } from "effect"
@@ -14725,7 +14725,7 @@ export const currentParentSpan: Effect<AnySpan, Cause.NoSuchElementError> = inte
14725
14725
  * These annotations are applied to spans created inside the context, such as
14726
14726
  * spans created by `withSpan`, `useSpan`, or `makeSpan`.
14727
14727
  *
14728
- * **Example** (Usage)
14728
+ * **Example** (Providing span annotations)
14729
14729
  *
14730
14730
  * ```ts
14731
14731
  * import { Effect } from "effect"
@@ -14759,7 +14759,7 @@ export const spanAnnotations: Effect<Readonly<Record<string, unknown>>> = intern
14759
14759
  * These links are attached to spans created inside the context. Span links
14760
14760
  * connect related spans without making one span the parent of another.
14761
14761
  *
14762
- * **Example** (Usage)
14762
+ * **Example** (Providing span links)
14763
14763
  *
14764
14764
  * ```ts
14765
14765
  * import { Effect } from "effect"
@@ -14784,7 +14784,7 @@ export const spanLinks: Effect<ReadonlyArray<SpanLink>> = internal.spanLinks
14784
14784
  * parent-child relationship. For example, you might want to link spans from
14785
14785
  * parallel operations or connect spans across different traces.
14786
14786
  *
14787
- * **Example** (Usage)
14787
+ * **Example** (Linking one span to another span)
14788
14788
  *
14789
14789
  * ```ts
14790
14790
  * import { Effect } from "effect"
@@ -14807,7 +14807,7 @@ export const spanLinks: Effect<ReadonlyArray<SpanLink>> = internal.spanLinks
14807
14807
  * })
14808
14808
  * ```
14809
14809
  *
14810
- * **Example** (Usage)
14810
+ * **Example** (Linking multiple spans at once)
14811
14811
  *
14812
14812
  * ```ts
14813
14813
  * import { Effect } from "effect"
@@ -14837,7 +14837,7 @@ export const linkSpans: {
14837
14837
  * parent-child relationship. For example, you might want to link spans from
14838
14838
  * parallel operations or connect spans across different traces.
14839
14839
  *
14840
- * **Example** (Usage)
14840
+ * **Example** (Linking one span to another span)
14841
14841
  *
14842
14842
  * ```ts
14843
14843
  * import { Effect } from "effect"
@@ -14860,7 +14860,7 @@ export const linkSpans: {
14860
14860
  * })
14861
14861
  * ```
14862
14862
  *
14863
- * **Example** (Usage)
14863
+ * **Example** (Linking multiple spans at once)
14864
14864
  *
14865
14865
  * ```ts
14866
14866
  * import { Effect } from "effect"
@@ -14893,7 +14893,7 @@ export const linkSpans: {
14893
14893
  * parent-child relationship. For example, you might want to link spans from
14894
14894
  * parallel operations or connect spans across different traces.
14895
14895
  *
14896
- * **Example** (Usage)
14896
+ * **Example** (Linking one span to another span)
14897
14897
  *
14898
14898
  * ```ts
14899
14899
  * import { Effect } from "effect"
@@ -14916,7 +14916,7 @@ export const linkSpans: {
14916
14916
  * })
14917
14917
  * ```
14918
14918
  *
14919
- * **Example** (Usage)
14919
+ * **Example** (Linking multiple spans at once)
14920
14920
  *
14921
14921
  * ```ts
14922
14922
  * import { Effect } from "effect"
@@ -14954,7 +14954,7 @@ export const linkSpans: {
14954
14954
  * automatically. Use `withSpan`, `useSpan`, or `makeSpanScoped` when the span
14955
14955
  * should be installed as context or closed automatically.
14956
14956
  *
14957
- * **Example** (Usage)
14957
+ * **Example** (Creating a span manually)
14958
14958
  *
14959
14959
  * ```ts
14960
14960
  * import { Effect } from "effect"
@@ -14978,7 +14978,7 @@ export const makeSpan: (name: string, options?: SpanOptionsNoTrace) => Effect<Sp
14978
14978
  * The span is not added to the current span stack, so no child spans will be
14979
14979
  * created for it.
14980
14980
  *
14981
- * **Example** (Usage)
14981
+ * **Example** (Creating a scoped standalone span)
14982
14982
  *
14983
14983
  * ```ts
14984
14984
  * import { Effect } from "effect"
@@ -15008,7 +15008,7 @@ export const makeSpanScoped: (
15008
15008
  * The span is not added to the current span stack, so no child spans will be
15009
15009
  * created for it.
15010
15010
  *
15011
- * **Example** (Usage)
15011
+ * **Example** (Running an effect with a standalone span)
15012
15012
  *
15013
15013
  * ```ts
15014
15014
  * import { Effect } from "effect"
@@ -15034,7 +15034,7 @@ export const useSpan: {
15034
15034
  * The span is not added to the current span stack, so no child spans will be
15035
15035
  * created for it.
15036
15036
  *
15037
- * **Example** (Usage)
15037
+ * **Example** (Running an effect with a standalone span)
15038
15038
  *
15039
15039
  * ```ts
15040
15040
  * import { Effect } from "effect"
@@ -15060,7 +15060,7 @@ export const useSpan: {
15060
15060
  * The span is not added to the current span stack, so no child spans will be
15061
15061
  * created for it.
15062
15062
  *
15063
- * **Example** (Usage)
15063
+ * **Example** (Running an effect with a standalone span)
15064
15064
  *
15065
15065
  * ```ts
15066
15066
  * import { Effect } from "effect"
@@ -15088,7 +15088,7 @@ export const useSpan: {
15088
15088
  /**
15089
15089
  * Wraps the effect with a new span for tracing.
15090
15090
  *
15091
- * **Example** (Usage)
15091
+ * **Example** (Wrapping an effect in a child span)
15092
15092
  *
15093
15093
  * ```ts
15094
15094
  * import { Effect } from "effect"
@@ -15110,7 +15110,7 @@ export const withSpan: {
15110
15110
  /**
15111
15111
  * Wraps the effect with a new span for tracing.
15112
15112
  *
15113
- * **Example** (Usage)
15113
+ * **Example** (Wrapping an effect in a child span)
15114
15114
  *
15115
15115
  * ```ts
15116
15116
  * import { Effect } from "effect"
@@ -15139,7 +15139,7 @@ export const withSpan: {
15139
15139
  /**
15140
15140
  * Wraps the effect with a new span for tracing.
15141
15141
  *
15142
- * **Example** (Usage)
15142
+ * **Example** (Wrapping an effect in a child span)
15143
15143
  *
15144
15144
  * ```ts
15145
15145
  * import { Effect } from "effect"
@@ -15165,7 +15165,7 @@ export const withSpan: {
15165
15165
  *
15166
15166
  * The span is ended when the Scope is finalized.
15167
15167
  *
15168
- * **Example** (Usage)
15168
+ * **Example** (Creating a scoped child span)
15169
15169
  *
15170
15170
  * ```ts
15171
15171
  * import { Effect } from "effect"
@@ -15188,7 +15188,7 @@ export const withSpanScoped: {
15188
15188
  *
15189
15189
  * The span is ended when the Scope is finalized.
15190
15190
  *
15191
- * **Example** (Usage)
15191
+ * **Example** (Creating a scoped child span)
15192
15192
  *
15193
15193
  * ```ts
15194
15194
  * import { Effect } from "effect"
@@ -15213,7 +15213,7 @@ export const withSpanScoped: {
15213
15213
  *
15214
15214
  * The span is ended when the Scope is finalized.
15215
15215
  *
15216
- * **Example** (Usage)
15216
+ * **Example** (Creating a scoped child span)
15217
15217
  *
15218
15218
  * ```ts
15219
15219
  * import { Effect } from "effect"
@@ -15236,7 +15236,7 @@ export const withSpanScoped: {
15236
15236
  /**
15237
15237
  * Adds the provided span to the current span stack.
15238
15238
  *
15239
- * **Example** (Usage)
15239
+ * **Example** (Setting a parent span)
15240
15240
  *
15241
15241
  * ```ts
15242
15242
  * import { Effect } from "effect"
@@ -15256,7 +15256,7 @@ export const withParentSpan: {
15256
15256
  /**
15257
15257
  * Adds the provided span to the current span stack.
15258
15258
  *
15259
- * **Example** (Usage)
15259
+ * **Example** (Setting a parent span)
15260
15260
  *
15261
15261
  * ```ts
15262
15262
  * import { Effect } from "effect"
@@ -15276,7 +15276,7 @@ export const withParentSpan: {
15276
15276
  /**
15277
15277
  * Adds the provided span to the current span stack.
15278
15278
  *
15279
- * **Example** (Usage)
15279
+ * **Example** (Setting a parent span)
15280
15280
  *
15281
15281
  * ```ts
15282
15282
  * import { Effect } from "effect"
@@ -15305,7 +15305,7 @@ export const withParentSpan: {
15305
15305
  * @category Requests & Batching
15306
15306
  * @since 2.0.0
15307
15307
  *
15308
- * **Example** (Usage)
15308
+ * **Example** (Executing a request through a resolver)
15309
15309
  *
15310
15310
  * ```ts
15311
15311
  * import { Console, Effect, Exit, Request, RequestResolver } from "effect"
@@ -15341,7 +15341,7 @@ export const request: {
15341
15341
  * @category Requests & Batching
15342
15342
  * @since 2.0.0
15343
15343
  *
15344
- * **Example** (Usage)
15344
+ * **Example** (Executing a request through a resolver)
15345
15345
  *
15346
15346
  * ```ts
15347
15347
  * import { Console, Effect, Exit, Request, RequestResolver } from "effect"
@@ -15377,7 +15377,7 @@ export const request: {
15377
15377
  * @category Requests & Batching
15378
15378
  * @since 2.0.0
15379
15379
  *
15380
- * **Example** (Usage)
15380
+ * **Example** (Executing a request through a resolver)
15381
15381
  *
15382
15382
  * ```ts
15383
15383
  * import { Console, Effect, Exit, Request, RequestResolver } from "effect"
@@ -15448,7 +15448,7 @@ export const requestUnsafe: <A extends Request.Any>(
15448
15448
  * fibers leak. This behavior is called "auto supervision", and if this
15449
15449
  * behavior is not desired, you may use the `forkDetach` or `forkIn` methods.
15450
15450
  *
15451
- * **Example** (Usage)
15451
+ * **Example** (Forking a child fiber)
15452
15452
  *
15453
15453
  * ```ts
15454
15454
  * import { Effect, Fiber } from "effect"
@@ -15495,7 +15495,7 @@ export const forkChild: <
15495
15495
  * Forks the effect in the specified scope. The fiber will be interrupted
15496
15496
  * when the scope is closed.
15497
15497
  *
15498
- * **Example** (Usage)
15498
+ * **Example** (Forking into a supplied scope)
15499
15499
  *
15500
15500
  * ```ts
15501
15501
  * import { Effect } from "effect"
@@ -15524,7 +15524,7 @@ export const forkIn: {
15524
15524
  * Forks the effect in the specified scope. The fiber will be interrupted
15525
15525
  * when the scope is closed.
15526
15526
  *
15527
- * **Example** (Usage)
15527
+ * **Example** (Forking into a supplied scope)
15528
15528
  *
15529
15529
  * ```ts
15530
15530
  * import { Effect } from "effect"
@@ -15559,7 +15559,7 @@ export const forkIn: {
15559
15559
  * Forks the effect in the specified scope. The fiber will be interrupted
15560
15560
  * when the scope is closed.
15561
15561
  *
15562
- * **Example** (Usage)
15562
+ * **Example** (Forking into a supplied scope)
15563
15563
  *
15564
15564
  * ```ts
15565
15565
  * import { Effect } from "effect"
@@ -15596,7 +15596,7 @@ export const forkIn: {
15596
15596
  /**
15597
15597
  * Forks the fiber in a `Scope`, interrupting it when the scope is closed.
15598
15598
  *
15599
- * **Example** (Usage)
15599
+ * **Example** (Forking into the current scope)
15600
15600
  *
15601
15601
  * ```ts
15602
15602
  * import { Effect } from "effect"
@@ -15648,7 +15648,7 @@ export const forkScoped: <
15648
15648
  * new fiber is attached to the global scope, when the fiber executing the
15649
15649
  * returned effect terminates, the forked fiber will continue running.
15650
15650
  *
15651
- * **Example** (Usage)
15651
+ * **Example** (Forking a detached fiber)
15652
15652
  *
15653
15653
  * ```ts
15654
15654
  * import { Effect } from "effect"
@@ -15705,7 +15705,7 @@ export const awaitAllChildren: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E,
15705
15705
  /**
15706
15706
  * Access the fiber currently executing the effect.
15707
15707
  *
15708
- * **Example** (Usage)
15708
+ * **Example** (Accessing the current fiber)
15709
15709
  *
15710
15710
  * ```ts
15711
15711
  * import { Console, Effect } from "effect"
@@ -15724,7 +15724,7 @@ export const fiber: Effect<Fiber<unknown, unknown>> = internal.fiber
15724
15724
  /**
15725
15725
  * Access the current fiber id executing the effect.
15726
15726
  *
15727
- * **Example** (Usage)
15727
+ * **Example** (Accessing the current fiber id)
15728
15728
  *
15729
15729
  * ```ts
15730
15730
  * import { Effect } from "effect"
@@ -15776,7 +15776,7 @@ export interface RunOptions {
15776
15776
  * Unless you specifically need a `Promise` or synchronous operation,
15777
15777
  * `runFork` is a good default choice.
15778
15778
  *
15779
- * **Example** (Running an Effect in the Background)
15779
+ * **Example** (Running an effect in the background)
15780
15780
  *
15781
15781
  * ```ts
15782
15782
  * import { Console, Effect, Fiber, Schedule } from "effect"
@@ -15806,7 +15806,7 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
15806
15806
  /**
15807
15807
  * Runs an effect in the background with the provided services.
15808
15808
  *
15809
- * **Example** (Usage)
15809
+ * **Example** (Running with services in the background)
15810
15810
  *
15811
15811
  * ```ts
15812
15812
  * import { Context, Effect } from "effect"
@@ -15842,7 +15842,7 @@ export const runForkWith: <R>(
15842
15842
  *
15843
15843
  * The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
15844
15844
  *
15845
- * **Example** (Usage)
15845
+ * **Example** (Running with services and a callback)
15846
15846
  *
15847
15847
  * ```ts
15848
15848
  * import { Console, Context, Effect, Exit } from "effect"
@@ -15892,7 +15892,7 @@ export const runCallbackWith: <R>(
15892
15892
  * The interruptor calls `fiber.interruptUnsafe` with the optional interruptor
15893
15893
  * id.
15894
15894
  *
15895
- * **Example** (Usage)
15895
+ * **Example** (Running with a callback)
15896
15896
  *
15897
15897
  * ```ts
15898
15898
  * import { Console, Effect, Exit } from "effect"
@@ -15942,7 +15942,7 @@ export const runCallback: <A, E>(
15942
15942
  *
15943
15943
  * @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
15944
15944
  *
15945
- * **Example** (Running a Successful Effect as a Promise)
15945
+ * **Example** (Running a successful effect as a Promise)
15946
15946
  *
15947
15947
  * ```ts
15948
15948
  * import { Effect } from "effect"
@@ -15951,7 +15951,7 @@ export const runCallback: <A, E>(
15951
15951
  * // Output: 1
15952
15952
  * ```
15953
15953
  *
15954
- * **Example** (Usage)
15954
+ * **Example** (Running effects as promises)
15955
15955
  *
15956
15956
  * ```ts
15957
15957
  * //Example: Handling a Failing Effect as a Rejected Promise
@@ -15973,7 +15973,7 @@ export const runPromise: <A, E>(
15973
15973
  /**
15974
15974
  * Executes an effect as a Promise with the provided services.
15975
15975
  *
15976
- * **Example** (Usage)
15976
+ * **Example** (Running with services as a promise)
15977
15977
  *
15978
15978
  * ```ts
15979
15979
  * import { Context, Effect } from "effect"
@@ -16019,7 +16019,7 @@ export const runPromiseWith: <R>(
16019
16019
  * - If it fails, the failure information is provided as a `Failure` containing
16020
16020
  * a `Cause` type.
16021
16021
  *
16022
- * **Example** (Handling Results as Exit)
16022
+ * **Example** (Observing promise results as Exit)
16023
16023
  *
16024
16024
  * ```ts
16025
16025
  * import { Effect } from "effect"
@@ -16058,7 +16058,7 @@ export const runPromiseExit: <A, E>(
16058
16058
  /**
16059
16059
  * Runs an effect and returns a Promise of Exit with provided services.
16060
16060
  *
16061
- * **Example** (Usage)
16061
+ * **Example** (Running with services as an Exit promise)
16062
16062
  *
16063
16063
  * ```ts
16064
16064
  * import { Context, Effect, Exit } from "effect"
@@ -16109,7 +16109,7 @@ export const runPromiseExitWith: <R>(
16109
16109
  * @see {@link runSyncExit} for a version that returns an `Exit` type instead of
16110
16110
  * throwing an error.
16111
16111
  *
16112
- * **Example** (Synchronous Logging)
16112
+ * **Example** (Running a synchronous effect)
16113
16113
  *
16114
16114
  * ```ts
16115
16115
  * import { Effect } from "effect"
@@ -16126,7 +16126,7 @@ export const runPromiseExitWith: <R>(
16126
16126
  * // Output: 1
16127
16127
  * ```
16128
16128
  *
16129
- * **Example** (Incorrect Usage with Failing or Async Effects)
16129
+ * **Example** (Throwing for failed or async effects)
16130
16130
  *
16131
16131
  * ```ts
16132
16132
  * import { Effect } from "effect"
@@ -16158,7 +16158,7 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
16158
16158
  /**
16159
16159
  * Executes an effect synchronously with provided services.
16160
16160
  *
16161
- * **Example** (Usage)
16161
+ * **Example** (Running synchronously with services)
16162
16162
  *
16163
16163
  * ```ts
16164
16164
  * import { Context, Effect } from "effect"
@@ -16209,7 +16209,7 @@ export const runSyncWith: <R>(
16209
16209
  * return an `Failure` with a `Die` cause, indicating that the effect cannot be
16210
16210
  * resolved synchronously.
16211
16211
  *
16212
- * **Example** (Handling Results as Exit)
16212
+ * **Example** (Observing synchronous results as Exit)
16213
16213
  *
16214
16214
  * ```ts
16215
16215
  * import { Effect } from "effect"
@@ -16235,7 +16235,7 @@ export const runSyncWith: <R>(
16235
16235
  * // }
16236
16236
  * ```
16237
16237
  *
16238
- * **Example** (Asynchronous Operation Resulting in Die)
16238
+ * **Example** (Capturing async work as a Die cause)
16239
16239
  *
16240
16240
  * ```ts
16241
16241
  * import { Effect } from "effect"
@@ -16265,7 +16265,7 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
16265
16265
  /**
16266
16266
  * Runs an effect synchronously with provided services, returning an Exit result.
16267
16267
  *
16268
- * **Example** (Usage)
16268
+ * **Example** (Running synchronously with services as Exit)
16269
16269
  *
16270
16270
  * ```ts
16271
16271
  * import { Context, Effect, Exit } from "effect"
@@ -20362,7 +20362,7 @@ export namespace fn {
20362
20362
  *
20363
20363
  * `Effect.fnUntraced` also acts as a `pipe` function, so you can append transforms after the body.
20364
20364
  *
20365
- * **Example** (Usage)
20365
+ * **Example** (Defining untraced effect functions)
20366
20366
  *
20367
20367
  * ```ts
20368
20368
  * import { Console, Effect } from "effect"
@@ -20385,7 +20385,7 @@ export const fnUntraced: fn.Untraced = internal.fnUntraced
20385
20385
  *
20386
20386
  * Pipeable functions run after the body and can transform the resulting Effect.
20387
20387
  *
20388
- * **Example** (Usage)
20388
+ * **Example** (Defining traced effect functions)
20389
20389
  *
20390
20390
  * ```ts
20391
20391
  * import { Console, Effect } from "effect"
@@ -20420,7 +20420,7 @@ export const fn: fn.Traced & {
20420
20420
  * Retrieves the `Clock` service from the context and provides it to the
20421
20421
  * specified effectful function.
20422
20422
  *
20423
- * **Example** (Usage)
20423
+ * **Example** (Accessing the Clock service)
20424
20424
  *
20425
20425
  * ```ts
20426
20426
  * import { Console, Effect } from "effect"
@@ -20454,7 +20454,7 @@ export const clockWith: <A, E, R>(
20454
20454
  * If no level is provided, the logger uses the fiber's current log level and
20455
20455
  * extracts any `Cause` values from the message list.
20456
20456
  *
20457
- * **Example** (Usage)
20457
+ * **Example** (Logging at a dynamic level)
20458
20458
  *
20459
20459
  * ```ts
20460
20460
  * import { Effect } from "effect"
@@ -20475,7 +20475,7 @@ export const logWithLevel: (level?: Severity) => (...message: ReadonlyArray<any>
20475
20475
  /**
20476
20476
  * Logs one or more messages using the default log level.
20477
20477
  *
20478
- * **Example** (Usage)
20478
+ * **Example** (Logging at the default level)
20479
20479
  *
20480
20480
  * ```ts
20481
20481
  * import { Effect } from "effect"
@@ -20504,7 +20504,7 @@ export const log: (...message: ReadonlyArray<any>) => Effect<void> = internal.lo
20504
20504
  /**
20505
20505
  * Logs one or more messages at the FATAL level.
20506
20506
  *
20507
- * **Example** (Usage)
20507
+ * **Example** (Logging fatal messages)
20508
20508
  *
20509
20509
  * ```ts
20510
20510
  * import { Effect } from "effect"
@@ -20534,7 +20534,7 @@ export const logFatal: (...message: ReadonlyArray<any>) => Effect<void> = intern
20534
20534
  /**
20535
20535
  * Logs one or more messages at the WARNING level.
20536
20536
  *
20537
- * **Example** (Usage)
20537
+ * **Example** (Logging warnings)
20538
20538
  *
20539
20539
  * ```ts
20540
20540
  * import { Effect } from "effect"
@@ -20565,7 +20565,7 @@ export const logWarning: (...message: ReadonlyArray<any>) => Effect<void> = inte
20565
20565
  /**
20566
20566
  * Logs one or more messages at the ERROR level.
20567
20567
  *
20568
- * **Example** (Usage)
20568
+ * **Example** (Logging errors)
20569
20569
  *
20570
20570
  * ```ts
20571
20571
  * import { Effect } from "effect"
@@ -20599,7 +20599,7 @@ export const logError: (...message: ReadonlyArray<any>) => Effect<void> = intern
20599
20599
  /**
20600
20600
  * Logs one or more messages at the INFO level.
20601
20601
  *
20602
- * **Example** (Usage)
20602
+ * **Example** (Logging information)
20603
20603
  *
20604
20604
  * ```ts
20605
20605
  * import { Effect } from "effect"
@@ -20628,7 +20628,7 @@ export const logInfo: (...message: ReadonlyArray<any>) => Effect<void> = interna
20628
20628
  /**
20629
20629
  * Logs one or more messages at the DEBUG level.
20630
20630
  *
20631
- * **Example** (Usage)
20631
+ * **Example** (Logging debug messages)
20632
20632
  *
20633
20633
  * ```ts
20634
20634
  * import { Effect } from "effect"
@@ -20658,7 +20658,7 @@ export const logDebug: (...message: ReadonlyArray<any>) => Effect<void> = intern
20658
20658
  /**
20659
20659
  * Logs one or more messages at the TRACE level.
20660
20660
  *
20661
- * **Example** (Usage)
20661
+ * **Example** (Logging trace messages)
20662
20662
  *
20663
20663
  * ```ts
20664
20664
  * import { Effect } from "effect"
@@ -20691,7 +20691,7 @@ export const logTrace: (...message: ReadonlyArray<any>) => Effect<void> = intern
20691
20691
  /**
20692
20692
  * Adds a logger to the set of loggers which will output logs for this effect.
20693
20693
  *
20694
- * **Example** (Usage)
20694
+ * **Example** (Adding a logger to an effect)
20695
20695
  *
20696
20696
  * ```ts
20697
20697
  * import { Effect, Logger } from "effect"
@@ -20720,7 +20720,7 @@ export const withLogger = dual<
20720
20720
  /**
20721
20721
  * Adds a logger to the set of loggers which will output logs for this effect.
20722
20722
  *
20723
- * **Example** (Usage)
20723
+ * **Example** (Adding a logger to an effect)
20724
20724
  *
20725
20725
  * ```ts
20726
20726
  * import { Effect, Logger } from "effect"
@@ -20749,7 +20749,7 @@ export const withLogger = dual<
20749
20749
  /**
20750
20750
  * Adds a logger to the set of loggers which will output logs for this effect.
20751
20751
  *
20752
- * **Example** (Usage)
20752
+ * **Example** (Adding a logger to an effect)
20753
20753
  *
20754
20754
  * ```ts
20755
20755
  * import { Effect, Logger } from "effect"
@@ -20785,7 +20785,7 @@ export const withLogger = dual<
20785
20785
  /**
20786
20786
  * Adds an annotation to each log line in this effect.
20787
20787
  *
20788
- * **Example** (Usage)
20788
+ * **Example** (Adding log annotations)
20789
20789
  *
20790
20790
  * ```ts
20791
20791
  * import { Effect } from "effect"
@@ -20816,7 +20816,7 @@ export const annotateLogs = dual<
20816
20816
  /**
20817
20817
  * Adds an annotation to each log line in this effect.
20818
20818
  *
20819
- * **Example** (Usage)
20819
+ * **Example** (Adding log annotations)
20820
20820
  *
20821
20821
  * ```ts
20822
20822
  * import { Effect } from "effect"
@@ -20855,7 +20855,7 @@ export const annotateLogs = dual<
20855
20855
  /**
20856
20856
  * Adds an annotation to each log line in this effect.
20857
20857
  *
20858
- * **Example** (Usage)
20858
+ * **Example** (Adding log annotations)
20859
20859
  *
20860
20860
  * ```ts
20861
20861
  * import { Effect } from "effect"
@@ -20917,7 +20917,7 @@ export const annotateLogs = dual<
20917
20917
  * `annotateLogsScoped` updates annotations for the entire current `Scope` and
20918
20918
  * restores the previous annotations when the scope closes.
20919
20919
  *
20920
- * **Example** (Usage)
20920
+ * **Example** (Adding scoped log annotations)
20921
20921
  *
20922
20922
  * ```ts
20923
20923
  * import { Effect } from "effect"
@@ -20944,7 +20944,7 @@ export const annotateLogsScoped: {
20944
20944
  * `annotateLogsScoped` updates annotations for the entire current `Scope` and
20945
20945
  * restores the previous annotations when the scope closes.
20946
20946
  *
20947
- * **Example** (Usage)
20947
+ * **Example** (Adding scoped log annotations)
20948
20948
  *
20949
20949
  * ```ts
20950
20950
  * import { Effect } from "effect"
@@ -20971,7 +20971,7 @@ export const annotateLogsScoped: {
20971
20971
  * `annotateLogsScoped` updates annotations for the entire current `Scope` and
20972
20972
  * restores the previous annotations when the scope closes.
20973
20973
  *
20974
- * **Example** (Usage)
20974
+ * **Example** (Adding scoped log annotations)
20975
20975
  *
20976
20976
  * ```ts
20977
20977
  * import { Effect } from "effect"
@@ -20996,7 +20996,7 @@ export const annotateLogsScoped: {
20996
20996
  /**
20997
20997
  * Adds a span to each log line in this effect.
20998
20998
  *
20999
- * **Example** (Usage)
20999
+ * **Example** (Adding a log span)
21000
21000
  *
21001
21001
  * ```ts
21002
21002
  * import { Effect } from "effect"
@@ -21028,7 +21028,7 @@ export const withLogSpan = dual<
21028
21028
  /**
21029
21029
  * Adds a span to each log line in this effect.
21030
21030
  *
21031
- * **Example** (Usage)
21031
+ * **Example** (Adding a log span)
21032
21032
  *
21033
21033
  * ```ts
21034
21034
  * import { Effect } from "effect"
@@ -21060,7 +21060,7 @@ export const withLogSpan = dual<
21060
21060
  /**
21061
21061
  * Adds a span to each log line in this effect.
21062
21062
  *
21063
- * **Example** (Usage)
21063
+ * **Example** (Adding a log span)
21064
21064
  *
21065
21065
  * ```ts
21066
21066
  * import { Effect } from "effect"
@@ -21109,7 +21109,7 @@ export const withLogSpan = dual<
21109
21109
  * Also accepts an optional function which can be used to map the `Exit` value
21110
21110
  * of the `Effect` into a valid `Input` for the `Metric`.
21111
21111
  *
21112
- * **Example** (Usage)
21112
+ * **Example** (Incrementing a metric for each execution)
21113
21113
  *
21114
21114
  * ```ts
21115
21115
  * import { Effect, Metric } from "effect"
@@ -21129,7 +21129,7 @@ export const withLogSpan = dual<
21129
21129
  * )
21130
21130
  * ```
21131
21131
  *
21132
- * **Example** (Usage)
21132
+ * **Example** (Mapping exits before updating a metric)
21133
21133
  *
21134
21134
  * ```ts
21135
21135
  * import { Effect, Exit, Metric } from "effect"
@@ -21164,7 +21164,7 @@ export const track: {
21164
21164
  * Also accepts an optional function which can be used to map the `Exit` value
21165
21165
  * of the `Effect` into a valid `Input` for the `Metric`.
21166
21166
  *
21167
- * **Example** (Usage)
21167
+ * **Example** (Incrementing a metric for each execution)
21168
21168
  *
21169
21169
  * ```ts
21170
21170
  * import { Effect, Metric } from "effect"
@@ -21184,7 +21184,7 @@ export const track: {
21184
21184
  * )
21185
21185
  * ```
21186
21186
  *
21187
- * **Example** (Usage)
21187
+ * **Example** (Mapping exits before updating a metric)
21188
21188
  *
21189
21189
  * ```ts
21190
21190
  * import { Effect, Exit, Metric } from "effect"
@@ -21219,7 +21219,7 @@ export const track: {
21219
21219
  * Also accepts an optional function which can be used to map the `Exit` value
21220
21220
  * of the `Effect` into a valid `Input` for the `Metric`.
21221
21221
  *
21222
- * **Example** (Usage)
21222
+ * **Example** (Incrementing a metric for each execution)
21223
21223
  *
21224
21224
  * ```ts
21225
21225
  * import { Effect, Metric } from "effect"
@@ -21239,7 +21239,7 @@ export const track: {
21239
21239
  * )
21240
21240
  * ```
21241
21241
  *
21242
- * **Example** (Usage)
21242
+ * **Example** (Mapping exits before updating a metric)
21243
21243
  *
21244
21244
  * ```ts
21245
21245
  * import { Effect, Exit, Metric } from "effect"
@@ -21274,7 +21274,7 @@ export const track: {
21274
21274
  * Also accepts an optional function which can be used to map the `Exit` value
21275
21275
  * of the `Effect` into a valid `Input` for the `Metric`.
21276
21276
  *
21277
- * **Example** (Usage)
21277
+ * **Example** (Incrementing a metric for each execution)
21278
21278
  *
21279
21279
  * ```ts
21280
21280
  * import { Effect, Metric } from "effect"
@@ -21294,7 +21294,7 @@ export const track: {
21294
21294
  * )
21295
21295
  * ```
21296
21296
  *
21297
- * **Example** (Usage)
21297
+ * **Example** (Mapping exits before updating a metric)
21298
21298
  *
21299
21299
  * ```ts
21300
21300
  * import { Effect, Exit, Metric } from "effect"
@@ -21333,7 +21333,7 @@ export const track: {
21333
21333
  * Also accepts an optional function which can be used to map the `Exit` value
21334
21334
  * of the `Effect` into a valid `Input` for the `Metric`.
21335
21335
  *
21336
- * **Example** (Usage)
21336
+ * **Example** (Incrementing a metric for each execution)
21337
21337
  *
21338
21338
  * ```ts
21339
21339
  * import { Effect, Metric } from "effect"
@@ -21353,7 +21353,7 @@ export const track: {
21353
21353
  * )
21354
21354
  * ```
21355
21355
  *
21356
- * **Example** (Usage)
21356
+ * **Example** (Mapping exits before updating a metric)
21357
21357
  *
21358
21358
  * ```ts
21359
21359
  * import { Effect, Exit, Metric } from "effect"
@@ -21401,7 +21401,7 @@ export const track: {
21401
21401
  * Also accepts an optional function which can be used to map the success value
21402
21402
  * of the `Effect` into a valid `Input` for the `Metric`.
21403
21403
  *
21404
- * **Example** (Usage)
21404
+ * **Example** (Counting successful results)
21405
21405
  *
21406
21406
  * ```ts
21407
21407
  * import { Effect, Metric } from "effect"
@@ -21420,7 +21420,7 @@ export const track: {
21420
21420
  * )
21421
21421
  * ```
21422
21422
  *
21423
- * **Example** (Usage)
21423
+ * **Example** (Mapping successes before tracking)
21424
21424
  *
21425
21425
  * ```ts
21426
21426
  * import { Effect, Metric } from "effect"
@@ -21449,7 +21449,7 @@ export const trackSuccesses: {
21449
21449
  * Also accepts an optional function which can be used to map the success value
21450
21450
  * of the `Effect` into a valid `Input` for the `Metric`.
21451
21451
  *
21452
- * **Example** (Usage)
21452
+ * **Example** (Counting successful results)
21453
21453
  *
21454
21454
  * ```ts
21455
21455
  * import { Effect, Metric } from "effect"
@@ -21468,7 +21468,7 @@ export const trackSuccesses: {
21468
21468
  * )
21469
21469
  * ```
21470
21470
  *
21471
- * **Example** (Usage)
21471
+ * **Example** (Mapping successes before tracking)
21472
21472
  *
21473
21473
  * ```ts
21474
21474
  * import { Effect, Metric } from "effect"
@@ -21497,7 +21497,7 @@ export const trackSuccesses: {
21497
21497
  * Also accepts an optional function which can be used to map the success value
21498
21498
  * of the `Effect` into a valid `Input` for the `Metric`.
21499
21499
  *
21500
- * **Example** (Usage)
21500
+ * **Example** (Counting successful results)
21501
21501
  *
21502
21502
  * ```ts
21503
21503
  * import { Effect, Metric } from "effect"
@@ -21516,7 +21516,7 @@ export const trackSuccesses: {
21516
21516
  * )
21517
21517
  * ```
21518
21518
  *
21519
- * **Example** (Usage)
21519
+ * **Example** (Mapping successes before tracking)
21520
21520
  *
21521
21521
  * ```ts
21522
21522
  * import { Effect, Metric } from "effect"
@@ -21545,7 +21545,7 @@ export const trackSuccesses: {
21545
21545
  * Also accepts an optional function which can be used to map the success value
21546
21546
  * of the `Effect` into a valid `Input` for the `Metric`.
21547
21547
  *
21548
- * **Example** (Usage)
21548
+ * **Example** (Counting successful results)
21549
21549
  *
21550
21550
  * ```ts
21551
21551
  * import { Effect, Metric } from "effect"
@@ -21564,7 +21564,7 @@ export const trackSuccesses: {
21564
21564
  * )
21565
21565
  * ```
21566
21566
  *
21567
- * **Example** (Usage)
21567
+ * **Example** (Mapping successes before tracking)
21568
21568
  *
21569
21569
  * ```ts
21570
21570
  * import { Effect, Metric } from "effect"
@@ -21597,7 +21597,7 @@ export const trackSuccesses: {
21597
21597
  * Also accepts an optional function which can be used to map the success value
21598
21598
  * of the `Effect` into a valid `Input` for the `Metric`.
21599
21599
  *
21600
- * **Example** (Usage)
21600
+ * **Example** (Counting successful results)
21601
21601
  *
21602
21602
  * ```ts
21603
21603
  * import { Effect, Metric } from "effect"
@@ -21616,7 +21616,7 @@ export const trackSuccesses: {
21616
21616
  * )
21617
21617
  * ```
21618
21618
  *
21619
- * **Example** (Usage)
21619
+ * **Example** (Mapping successes before tracking)
21620
21620
  *
21621
21621
  * ```ts
21622
21622
  * import { Effect, Metric } from "effect"
@@ -21658,7 +21658,7 @@ export const trackSuccesses: {
21658
21658
  * Also accepts an optional function which can be used to map the error value
21659
21659
  * of the `Effect` into a valid `Input` for the `Metric`.
21660
21660
  *
21661
- * **Example** (Usage)
21661
+ * **Example** (Counting expected failures)
21662
21662
  *
21663
21663
  * ```ts
21664
21664
  * import { Effect, Metric } from "effect"
@@ -21677,7 +21677,7 @@ export const trackSuccesses: {
21677
21677
  * )
21678
21678
  * ```
21679
21679
  *
21680
- * **Example** (Usage)
21680
+ * **Example** (Mapping errors before tracking)
21681
21681
  *
21682
21682
  * ```ts
21683
21683
  * import { Data, Effect, Metric } from "effect"
@@ -21708,7 +21708,7 @@ export const trackErrors: {
21708
21708
  * Also accepts an optional function which can be used to map the error value
21709
21709
  * of the `Effect` into a valid `Input` for the `Metric`.
21710
21710
  *
21711
- * **Example** (Usage)
21711
+ * **Example** (Counting expected failures)
21712
21712
  *
21713
21713
  * ```ts
21714
21714
  * import { Effect, Metric } from "effect"
@@ -21727,7 +21727,7 @@ export const trackErrors: {
21727
21727
  * )
21728
21728
  * ```
21729
21729
  *
21730
- * **Example** (Usage)
21730
+ * **Example** (Mapping errors before tracking)
21731
21731
  *
21732
21732
  * ```ts
21733
21733
  * import { Data, Effect, Metric } from "effect"
@@ -21758,7 +21758,7 @@ export const trackErrors: {
21758
21758
  * Also accepts an optional function which can be used to map the error value
21759
21759
  * of the `Effect` into a valid `Input` for the `Metric`.
21760
21760
  *
21761
- * **Example** (Usage)
21761
+ * **Example** (Counting expected failures)
21762
21762
  *
21763
21763
  * ```ts
21764
21764
  * import { Effect, Metric } from "effect"
@@ -21777,7 +21777,7 @@ export const trackErrors: {
21777
21777
  * )
21778
21778
  * ```
21779
21779
  *
21780
- * **Example** (Usage)
21780
+ * **Example** (Mapping errors before tracking)
21781
21781
  *
21782
21782
  * ```ts
21783
21783
  * import { Data, Effect, Metric } from "effect"
@@ -21808,7 +21808,7 @@ export const trackErrors: {
21808
21808
  * Also accepts an optional function which can be used to map the error value
21809
21809
  * of the `Effect` into a valid `Input` for the `Metric`.
21810
21810
  *
21811
- * **Example** (Usage)
21811
+ * **Example** (Counting expected failures)
21812
21812
  *
21813
21813
  * ```ts
21814
21814
  * import { Effect, Metric } from "effect"
@@ -21827,7 +21827,7 @@ export const trackErrors: {
21827
21827
  * )
21828
21828
  * ```
21829
21829
  *
21830
- * **Example** (Usage)
21830
+ * **Example** (Mapping errors before tracking)
21831
21831
  *
21832
21832
  * ```ts
21833
21833
  * import { Data, Effect, Metric } from "effect"
@@ -21862,7 +21862,7 @@ export const trackErrors: {
21862
21862
  * Also accepts an optional function which can be used to map the error value
21863
21863
  * of the `Effect` into a valid `Input` for the `Metric`.
21864
21864
  *
21865
- * **Example** (Usage)
21865
+ * **Example** (Counting expected failures)
21866
21866
  *
21867
21867
  * ```ts
21868
21868
  * import { Effect, Metric } from "effect"
@@ -21881,7 +21881,7 @@ export const trackErrors: {
21881
21881
  * )
21882
21882
  * ```
21883
21883
  *
21884
- * **Example** (Usage)
21884
+ * **Example** (Mapping errors before tracking)
21885
21885
  *
21886
21886
  * ```ts
21887
21887
  * import { Data, Effect, Metric } from "effect"
@@ -21925,7 +21925,7 @@ export const trackErrors: {
21925
21925
  * Also accepts an optional function which can be used to map the defect value
21926
21926
  * of the `Effect` into a valid `Input` for the `Metric`.
21927
21927
  *
21928
- * **Example** (Usage)
21928
+ * **Example** (Counting defects)
21929
21929
  *
21930
21930
  * ```ts
21931
21931
  * import { Effect, Metric } from "effect"
@@ -21944,7 +21944,7 @@ export const trackErrors: {
21944
21944
  * )
21945
21945
  * ```
21946
21946
  *
21947
- * **Example** (Usage)
21947
+ * **Example** (Mapping defects before tracking)
21948
21948
  *
21949
21949
  * ```ts
21950
21950
  * import { Effect, Metric } from "effect"
@@ -21976,7 +21976,7 @@ export const trackDefects: {
21976
21976
  * Also accepts an optional function which can be used to map the defect value
21977
21977
  * of the `Effect` into a valid `Input` for the `Metric`.
21978
21978
  *
21979
- * **Example** (Usage)
21979
+ * **Example** (Counting defects)
21980
21980
  *
21981
21981
  * ```ts
21982
21982
  * import { Effect, Metric } from "effect"
@@ -21995,7 +21995,7 @@ export const trackDefects: {
21995
21995
  * )
21996
21996
  * ```
21997
21997
  *
21998
- * **Example** (Usage)
21998
+ * **Example** (Mapping defects before tracking)
21999
21999
  *
22000
22000
  * ```ts
22001
22001
  * import { Effect, Metric } from "effect"
@@ -22027,7 +22027,7 @@ export const trackDefects: {
22027
22027
  * Also accepts an optional function which can be used to map the defect value
22028
22028
  * of the `Effect` into a valid `Input` for the `Metric`.
22029
22029
  *
22030
- * **Example** (Usage)
22030
+ * **Example** (Counting defects)
22031
22031
  *
22032
22032
  * ```ts
22033
22033
  * import { Effect, Metric } from "effect"
@@ -22046,7 +22046,7 @@ export const trackDefects: {
22046
22046
  * )
22047
22047
  * ```
22048
22048
  *
22049
- * **Example** (Usage)
22049
+ * **Example** (Mapping defects before tracking)
22050
22050
  *
22051
22051
  * ```ts
22052
22052
  * import { Effect, Metric } from "effect"
@@ -22078,7 +22078,7 @@ export const trackDefects: {
22078
22078
  * Also accepts an optional function which can be used to map the defect value
22079
22079
  * of the `Effect` into a valid `Input` for the `Metric`.
22080
22080
  *
22081
- * **Example** (Usage)
22081
+ * **Example** (Counting defects)
22082
22082
  *
22083
22083
  * ```ts
22084
22084
  * import { Effect, Metric } from "effect"
@@ -22097,7 +22097,7 @@ export const trackDefects: {
22097
22097
  * )
22098
22098
  * ```
22099
22099
  *
22100
- * **Example** (Usage)
22100
+ * **Example** (Mapping defects before tracking)
22101
22101
  *
22102
22102
  * ```ts
22103
22103
  * import { Effect, Metric } from "effect"
@@ -22133,7 +22133,7 @@ export const trackDefects: {
22133
22133
  * Also accepts an optional function which can be used to map the defect value
22134
22134
  * of the `Effect` into a valid `Input` for the `Metric`.
22135
22135
  *
22136
- * **Example** (Usage)
22136
+ * **Example** (Counting defects)
22137
22137
  *
22138
22138
  * ```ts
22139
22139
  * import { Effect, Metric } from "effect"
@@ -22152,7 +22152,7 @@ export const trackDefects: {
22152
22152
  * )
22153
22153
  * ```
22154
22154
  *
22155
- * **Example** (Usage)
22155
+ * **Example** (Mapping defects before tracking)
22156
22156
  *
22157
22157
  * ```ts
22158
22158
  * import { Effect, Metric } from "effect"
@@ -22194,7 +22194,7 @@ export const trackDefects: {
22194
22194
  * that the wrapped `Effect` took to complete into a valid `Input` for the
22195
22195
  * `Metric`.
22196
22196
  *
22197
- * **Example** (Usage)
22197
+ * **Example** (Recording execution duration)
22198
22198
  *
22199
22199
  * ```ts
22200
22200
  * import { Effect, Metric } from "effect"
@@ -22211,7 +22211,7 @@ export const trackDefects: {
22211
22211
  * )
22212
22212
  * ```
22213
22213
  *
22214
- * **Example** (Usage)
22214
+ * **Example** (Mapping duration before tracking)
22215
22215
  *
22216
22216
  * ```ts
22217
22217
  * import { Duration, Effect, Metric } from "effect"
@@ -22241,7 +22241,7 @@ export const trackDuration: {
22241
22241
  * that the wrapped `Effect` took to complete into a valid `Input` for the
22242
22242
  * `Metric`.
22243
22243
  *
22244
- * **Example** (Usage)
22244
+ * **Example** (Recording execution duration)
22245
22245
  *
22246
22246
  * ```ts
22247
22247
  * import { Effect, Metric } from "effect"
@@ -22258,7 +22258,7 @@ export const trackDuration: {
22258
22258
  * )
22259
22259
  * ```
22260
22260
  *
22261
- * **Example** (Usage)
22261
+ * **Example** (Mapping duration before tracking)
22262
22262
  *
22263
22263
  * ```ts
22264
22264
  * import { Duration, Effect, Metric } from "effect"
@@ -22291,7 +22291,7 @@ export const trackDuration: {
22291
22291
  * that the wrapped `Effect` took to complete into a valid `Input` for the
22292
22292
  * `Metric`.
22293
22293
  *
22294
- * **Example** (Usage)
22294
+ * **Example** (Recording execution duration)
22295
22295
  *
22296
22296
  * ```ts
22297
22297
  * import { Effect, Metric } from "effect"
@@ -22308,7 +22308,7 @@ export const trackDuration: {
22308
22308
  * )
22309
22309
  * ```
22310
22310
  *
22311
- * **Example** (Usage)
22311
+ * **Example** (Mapping duration before tracking)
22312
22312
  *
22313
22313
  * ```ts
22314
22314
  * import { Duration, Effect, Metric } from "effect"
@@ -22338,7 +22338,7 @@ export const trackDuration: {
22338
22338
  * that the wrapped `Effect` took to complete into a valid `Input` for the
22339
22339
  * `Metric`.
22340
22340
  *
22341
- * **Example** (Usage)
22341
+ * **Example** (Recording execution duration)
22342
22342
  *
22343
22343
  * ```ts
22344
22344
  * import { Effect, Metric } from "effect"
@@ -22355,7 +22355,7 @@ export const trackDuration: {
22355
22355
  * )
22356
22356
  * ```
22357
22357
  *
22358
- * **Example** (Usage)
22358
+ * **Example** (Mapping duration before tracking)
22359
22359
  *
22360
22360
  * ```ts
22361
22361
  * import { Duration, Effect, Metric } from "effect"
@@ -22389,7 +22389,7 @@ export const trackDuration: {
22389
22389
  * that the wrapped `Effect` took to complete into a valid `Input` for the
22390
22390
  * `Metric`.
22391
22391
  *
22392
- * **Example** (Usage)
22392
+ * **Example** (Recording execution duration)
22393
22393
  *
22394
22394
  * ```ts
22395
22395
  * import { Effect, Metric } from "effect"
@@ -22406,7 +22406,7 @@ export const trackDuration: {
22406
22406
  * )
22407
22407
  * ```
22408
22408
  *
22409
- * **Example** (Usage)
22409
+ * **Example** (Mapping duration before tracking)
22410
22410
  *
22411
22411
  * ```ts
22412
22412
  * import { Duration, Effect, Metric } from "effect"
@@ -22459,7 +22459,7 @@ export const trackDuration: {
22459
22459
  * - a journal that stores any non committed change to TxRef values
22460
22460
  * - a retry flag to know if the transaction should be retried
22461
22461
  *
22462
- * **Example** (Usage)
22462
+ * **Example** (Building transactions)
22463
22463
  *
22464
22464
  * ```ts
22465
22465
  * import { Effect } from "effect"
@@ -22507,7 +22507,7 @@ export class Transaction extends Context.Service<
22507
22507
  * The outermost `tx` call creates the transaction boundary and commits or rolls back the full
22508
22508
  * composed transaction.
22509
22509
  *
22510
- * **Example** (Usage)
22510
+ * **Example** (Running a transaction)
22511
22511
  *
22512
22512
  * ```ts
22513
22513
  * import { Effect, TxRef } from "effect"
@@ -22629,7 +22629,7 @@ function clearTransaction(state: Transaction["Service"]) {
22629
22629
  * @category Transactions
22630
22630
  * @since 4.0.0
22631
22631
  *
22632
- * **Example** (Usage)
22632
+ * **Example** (Retrying transactions)
22633
22633
  *
22634
22634
  * ```ts
22635
22635
  * import { Effect, TxRef } from "effect"
@@ -22923,7 +22923,7 @@ export declare namespace Effectify {
22923
22923
  * callback errors and `onSyncError` to turn synchronous throws into typed
22924
22924
  * failures; otherwise synchronous throws become defects.
22925
22925
  *
22926
- * **Example** (Basic Usage)
22926
+ * **Example** (Converting callbacks to effects)
22927
22927
  *
22928
22928
  * ```ts
22929
22929
  * import { Effect } from "effect"
@@ -22939,7 +22939,7 @@ export declare namespace Effectify {
22939
22939
  * // Output: contents of package.json
22940
22940
  * ```
22941
22941
  *
22942
- * **Example** (Custom Error Handling)
22942
+ * **Example** (Mapping callback errors to typed failures)
22943
22943
  *
22944
22944
  * ```ts
22945
22945
  * import { Effect } from "effect"
@@ -22972,7 +22972,7 @@ export const effectify: {
22972
22972
  * callback errors and `onSyncError` to turn synchronous throws into typed
22973
22973
  * failures; otherwise synchronous throws become defects.
22974
22974
  *
22975
- * **Example** (Basic Usage)
22975
+ * **Example** (Converting callbacks to effects)
22976
22976
  *
22977
22977
  * ```ts
22978
22978
  * import { Effect } from "effect"
@@ -22988,7 +22988,7 @@ export const effectify: {
22988
22988
  * // Output: contents of package.json
22989
22989
  * ```
22990
22990
  *
22991
- * **Example** (Custom Error Handling)
22991
+ * **Example** (Mapping callback errors to typed failures)
22992
22992
  *
22993
22993
  * ```ts
22994
22994
  * import { Effect } from "effect"
@@ -23021,7 +23021,7 @@ export const effectify: {
23021
23021
  * callback errors and `onSyncError` to turn synchronous throws into typed
23022
23022
  * failures; otherwise synchronous throws become defects.
23023
23023
  *
23024
- * **Example** (Basic Usage)
23024
+ * **Example** (Converting callbacks to effects)
23025
23025
  *
23026
23026
  * ```ts
23027
23027
  * import { Effect } from "effect"
@@ -23037,7 +23037,7 @@ export const effectify: {
23037
23037
  * // Output: contents of package.json
23038
23038
  * ```
23039
23039
  *
23040
- * **Example** (Custom Error Handling)
23040
+ * **Example** (Mapping callback errors to typed failures)
23041
23041
  *
23042
23042
  * ```ts
23043
23043
  * import { Effect } from "effect"
@@ -23073,7 +23073,7 @@ export const effectify: {
23073
23073
  * callback errors and `onSyncError` to turn synchronous throws into typed
23074
23074
  * failures; otherwise synchronous throws become defects.
23075
23075
  *
23076
- * **Example** (Basic Usage)
23076
+ * **Example** (Converting callbacks to effects)
23077
23077
  *
23078
23078
  * ```ts
23079
23079
  * import { Effect } from "effect"
@@ -23089,7 +23089,7 @@ export const effectify: {
23089
23089
  * // Output: contents of package.json
23090
23090
  * ```
23091
23091
  *
23092
- * **Example** (Custom Error Handling)
23092
+ * **Example** (Mapping callback errors to typed failures)
23093
23093
  *
23094
23094
  * ```ts
23095
23095
  * import { Effect } from "effect"
@@ -23141,7 +23141,7 @@ export const effectify: {
23141
23141
  * This function provides compile-time type checking to ensure that the success
23142
23142
  * value of an effect conforms to a specific type constraint.
23143
23143
  *
23144
- * **Example** (Usage)
23144
+ * **Example** (Constraining the success type)
23145
23145
  *
23146
23146
  * ```ts
23147
23147
  * import { Effect } from "effect"
@@ -23169,7 +23169,7 @@ export const satisfiesSuccessType = <A>() => <A2 extends A, E, R>(effect: Effect
23169
23169
  * This function provides compile-time type checking to ensure that the error
23170
23170
  * type of an effect conforms to a specific type constraint.
23171
23171
  *
23172
- * **Example** (Usage)
23172
+ * **Example** (Constraining the error type)
23173
23173
  *
23174
23174
  * ```ts
23175
23175
  * import { Data, Effect } from "effect"
@@ -23199,7 +23199,7 @@ export const satisfiesErrorType = <E>() => <A, E2 extends E, R>(effect: Effect<A
23199
23199
  * This function provides compile-time type checking to ensure that the
23200
23200
  * requirements (context) type of an effect conforms to a specific type constraint.
23201
23201
  *
23202
- * **Example** (Usage)
23202
+ * **Example** (Constraining the services type)
23203
23203
  *
23204
23204
  * ```ts
23205
23205
  * import { Effect } from "effect"
@@ -23237,7 +23237,7 @@ export const satisfiesServicesType = <R>() => <A, E, R2 extends R>(effect: Effec
23237
23237
  * - For **Failure effects**: Returns the failure as-is without applying the mapping
23238
23238
  * - For **Pending effects**: Falls back to the regular `map` behavior
23239
23239
  *
23240
- * **Example** (Usage)
23240
+ * **Example** (Mapping already completed effects)
23241
23241
  *
23242
23242
  * ```ts
23243
23243
  * import { Effect } from "effect"
@@ -23271,7 +23271,7 @@ export const mapEager: {
23271
23271
  * - For **Failure effects**: Returns the failure as-is without applying the mapping
23272
23272
  * - For **Pending effects**: Falls back to the regular `map` behavior
23273
23273
  *
23274
- * **Example** (Usage)
23274
+ * **Example** (Mapping already completed effects)
23275
23275
  *
23276
23276
  * ```ts
23277
23277
  * import { Effect } from "effect"
@@ -23305,7 +23305,7 @@ export const mapEager: {
23305
23305
  * - For **Failure effects**: Returns the failure as-is without applying the mapping
23306
23306
  * - For **Pending effects**: Falls back to the regular `map` behavior
23307
23307
  *
23308
- * **Example** (Usage)
23308
+ * **Example** (Mapping already completed effects)
23309
23309
  *
23310
23310
  * ```ts
23311
23311
  * import { Effect } from "effect"
@@ -23341,7 +23341,7 @@ export const mapEager: {
23341
23341
  * - For **Failure effects**: Applies the mapping function immediately to the error
23342
23342
  * - For **Pending effects**: Falls back to the regular `mapError` behavior
23343
23343
  *
23344
- * **Example** (Usage)
23344
+ * **Example** (Mapping errors eagerly when possible)
23345
23345
  *
23346
23346
  * ```ts
23347
23347
  * import { Effect } from "effect"
@@ -23378,7 +23378,7 @@ export const mapErrorEager: {
23378
23378
  * - For **Failure effects**: Applies the mapping function immediately to the error
23379
23379
  * - For **Pending effects**: Falls back to the regular `mapError` behavior
23380
23380
  *
23381
- * **Example** (Usage)
23381
+ * **Example** (Mapping errors eagerly when possible)
23382
23382
  *
23383
23383
  * ```ts
23384
23384
  * import { Effect } from "effect"
@@ -23415,7 +23415,7 @@ export const mapErrorEager: {
23415
23415
  * - For **Failure effects**: Applies the mapping function immediately to the error
23416
23416
  * - For **Pending effects**: Falls back to the regular `mapError` behavior
23417
23417
  *
23418
- * **Example** (Usage)
23418
+ * **Example** (Mapping errors eagerly when possible)
23419
23419
  *
23420
23420
  * ```ts
23421
23421
  * import { Effect } from "effect"
@@ -23454,7 +23454,7 @@ export const mapErrorEager: {
23454
23454
  * - For **Failure effects**: Applies the `onFailure` function immediately to the error
23455
23455
  * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
23456
23456
  *
23457
- * **Example** (Usage)
23457
+ * **Example** (Mapping both channels eagerly when possible)
23458
23458
  *
23459
23459
  * ```ts
23460
23460
  * import { Effect } from "effect"
@@ -23493,7 +23493,7 @@ export const mapBothEager: {
23493
23493
  * - For **Failure effects**: Applies the `onFailure` function immediately to the error
23494
23494
  * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
23495
23495
  *
23496
- * **Example** (Usage)
23496
+ * **Example** (Mapping both channels eagerly when possible)
23497
23497
  *
23498
23498
  * ```ts
23499
23499
  * import { Effect } from "effect"
@@ -23534,7 +23534,7 @@ export const mapBothEager: {
23534
23534
  * - For **Failure effects**: Applies the `onFailure` function immediately to the error
23535
23535
  * - For **Pending effects**: Falls back to the regular `mapBoth` behavior
23536
23536
  *
23537
- * **Example** (Usage)
23537
+ * **Example** (Mapping both channels eagerly when possible)
23538
23538
  *
23539
23539
  * ```ts
23540
23540
  * import { Effect } from "effect"
@@ -23578,7 +23578,7 @@ export const mapBothEager: {
23578
23578
  * - For **Failure effects**: Returns the failure as-is without applying the flatMap
23579
23579
  * - For **Pending effects**: Falls back to the regular `flatMap` behavior
23580
23580
  *
23581
- * **Example** (Usage)
23581
+ * **Example** (Flat mapping eagerly when possible)
23582
23582
  *
23583
23583
  * ```ts
23584
23584
  * import { Effect } from "effect"
@@ -23615,7 +23615,7 @@ export const flatMapEager: {
23615
23615
  * - For **Failure effects**: Returns the failure as-is without applying the flatMap
23616
23616
  * - For **Pending effects**: Falls back to the regular `flatMap` behavior
23617
23617
  *
23618
- * **Example** (Usage)
23618
+ * **Example** (Flat mapping eagerly when possible)
23619
23619
  *
23620
23620
  * ```ts
23621
23621
  * import { Effect } from "effect"
@@ -23652,7 +23652,7 @@ export const flatMapEager: {
23652
23652
  * - For **Failure effects**: Returns the failure as-is without applying the flatMap
23653
23653
  * - For **Pending effects**: Falls back to the regular `flatMap` behavior
23654
23654
  *
23655
- * **Example** (Usage)
23655
+ * **Example** (Flat mapping eagerly when possible)
23656
23656
  *
23657
23657
  * ```ts
23658
23658
  * import { Effect } from "effect"
@@ -23691,7 +23691,7 @@ export const flatMapEager: {
23691
23691
  * - For **Failure effects**: Applies the catch function immediately to the error
23692
23692
  * - For **Pending effects**: Falls back to the regular `catch` behavior
23693
23693
  *
23694
- * **Example** (Usage)
23694
+ * **Example** (Catching failures eagerly when possible)
23695
23695
  *
23696
23696
  * ```ts
23697
23697
  * import { Effect } from "effect"
@@ -23738,7 +23738,7 @@ export const catchEager: {
23738
23738
  * - For **Failure effects**: Applies the catch function immediately to the error
23739
23739
  * - For **Pending effects**: Falls back to the regular `catch` behavior
23740
23740
  *
23741
- * **Example** (Usage)
23741
+ * **Example** (Catching failures eagerly when possible)
23742
23742
  *
23743
23743
  * ```ts
23744
23744
  * import { Effect } from "effect"
@@ -23785,7 +23785,7 @@ export const catchEager: {
23785
23785
  * - For **Failure effects**: Applies the catch function immediately to the error
23786
23786
  * - For **Pending effects**: Falls back to the regular `catch` behavior
23787
23787
  *
23788
- * **Example** (Usage)
23788
+ * **Example** (Catching failures eagerly when possible)
23789
23789
  *
23790
23790
  * ```ts
23791
23791
  * import { Effect } from "effect"
@@ -23824,7 +23824,7 @@ export const catchEager: {
23824
23824
  * Executes generator functions eagerly when all yielded effects are synchronous,
23825
23825
  * stopping at the first async effect and deferring to normal execution.
23826
23826
  *
23827
- * **Example** (Usage)
23827
+ * **Example** (Defining eager untraced effect functions)
23828
23828
  *
23829
23829
  * ```ts
23830
23830
  * import { Effect } from "effect"