effect 4.0.0-beta.82 → 4.0.0-beta.84

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 (199) hide show
  1. package/dist/Array.d.ts +64 -64
  2. package/dist/Array.js +26 -26
  3. package/dist/Cache.d.ts +1 -1
  4. package/dist/Cache.js +1 -1
  5. package/dist/Cause.d.ts +68 -68
  6. package/dist/Cause.js +47 -47
  7. package/dist/Channel.d.ts +5 -5
  8. package/dist/Channel.js +3 -3
  9. package/dist/Clock.d.ts +1 -1
  10. package/dist/Clock.js +1 -1
  11. package/dist/Combiner.d.ts +9 -9
  12. package/dist/Combiner.js +8 -8
  13. package/dist/Config.d.ts +15 -94
  14. package/dist/Config.d.ts.map +1 -1
  15. package/dist/Config.js +22 -70
  16. package/dist/Config.js.map +1 -1
  17. package/dist/ConfigProvider.d.ts +58 -74
  18. package/dist/ConfigProvider.d.ts.map +1 -1
  19. package/dist/ConfigProvider.js +66 -41
  20. package/dist/ConfigProvider.js.map +1 -1
  21. package/dist/Console.d.ts +1 -1
  22. package/dist/Console.js +1 -1
  23. package/dist/Data.d.ts +15 -15
  24. package/dist/Data.js +3 -3
  25. package/dist/DateTime.d.ts +6 -6
  26. package/dist/DateTime.js +2 -2
  27. package/dist/Duration.d.ts +3 -3
  28. package/dist/Duration.js +3 -3
  29. package/dist/Effect.d.ts +84 -45
  30. package/dist/Effect.d.ts.map +1 -1
  31. package/dist/Effect.js +72 -33
  32. package/dist/Effect.js.map +1 -1
  33. package/dist/Equal.d.ts +7 -7
  34. package/dist/Equal.js +5 -5
  35. package/dist/Equivalence.d.ts +17 -17
  36. package/dist/Equivalence.js +13 -13
  37. package/dist/Exit.d.ts +3 -3
  38. package/dist/Exit.js +3 -3
  39. package/dist/Formatter.d.ts +5 -5
  40. package/dist/Formatter.js +4 -4
  41. package/dist/Function.d.ts +10 -10
  42. package/dist/Function.js +3 -3
  43. package/dist/HashMap.d.ts +3 -3
  44. package/dist/HashMap.js +1 -1
  45. package/dist/Iterable.d.ts +6 -6
  46. package/dist/Iterable.js +2 -2
  47. package/dist/JsonPatch.d.ts +2 -2
  48. package/dist/Layer.d.ts +1 -1
  49. package/dist/Layer.js +1 -1
  50. package/dist/Logger.d.ts +1 -1
  51. package/dist/Logger.js +1 -1
  52. package/dist/Match.d.ts +8 -8
  53. package/dist/Match.js +8 -8
  54. package/dist/Metric.d.ts +3 -3
  55. package/dist/Metric.js +3 -3
  56. package/dist/Optic.d.ts +30 -30
  57. package/dist/Optic.js +12 -12
  58. package/dist/Option.d.ts +7 -7
  59. package/dist/Option.js +7 -7
  60. package/dist/Order.d.ts +23 -23
  61. package/dist/Order.js +20 -20
  62. package/dist/Pool.d.ts +1 -1
  63. package/dist/Pool.js +1 -1
  64. package/dist/Predicate.d.ts +88 -88
  65. package/dist/Predicate.js +47 -47
  66. package/dist/PubSub.d.ts +3 -3
  67. package/dist/PubSub.js +3 -3
  68. package/dist/Reducer.d.ts +1 -1
  69. package/dist/Reducer.js +1 -1
  70. package/dist/Result.d.ts +18 -18
  71. package/dist/Result.js +8 -8
  72. package/dist/Runtime.d.ts +1 -1
  73. package/dist/Runtime.js +1 -1
  74. package/dist/Schema.d.ts +265 -120
  75. package/dist/Schema.d.ts.map +1 -1
  76. package/dist/Schema.js +285 -116
  77. package/dist/Schema.js.map +1 -1
  78. package/dist/SchemaAST.d.ts +1 -1
  79. package/dist/SchemaAST.d.ts.map +1 -1
  80. package/dist/SchemaAST.js +13 -9
  81. package/dist/SchemaAST.js.map +1 -1
  82. package/dist/SchemaGetter.d.ts +48 -48
  83. package/dist/SchemaGetter.js +44 -44
  84. package/dist/SchemaIssue.d.ts +3 -3
  85. package/dist/SchemaIssue.js +3 -3
  86. package/dist/SchemaParser.d.ts +122 -22
  87. package/dist/SchemaParser.d.ts.map +1 -1
  88. package/dist/SchemaParser.js +186 -50
  89. package/dist/SchemaParser.js.map +1 -1
  90. package/dist/SchemaRepresentation.d.ts +1 -1
  91. package/dist/SchemaRepresentation.d.ts.map +1 -1
  92. package/dist/SchemaRepresentation.js +96 -2
  93. package/dist/SchemaRepresentation.js.map +1 -1
  94. package/dist/SchemaTransformation.d.ts +20 -20
  95. package/dist/SchemaTransformation.js +18 -18
  96. package/dist/Stream.d.ts +3 -3
  97. package/dist/Stream.js +2 -2
  98. package/dist/Stream.js.map +1 -1
  99. package/dist/String.d.ts +1 -1
  100. package/dist/String.js +1 -1
  101. package/dist/Struct.d.ts +1 -1
  102. package/dist/Struct.js +1 -1
  103. package/dist/Types.d.ts +13 -13
  104. package/dist/internal/effect.js +23 -10
  105. package/dist/internal/effect.js.map +1 -1
  106. package/dist/internal/schema/cause.d.ts +2 -0
  107. package/dist/internal/schema/cause.d.ts.map +1 -0
  108. package/dist/internal/schema/cause.js +24 -0
  109. package/dist/internal/schema/cause.js.map +1 -0
  110. package/dist/internal/schema/schema.d.ts +8 -4
  111. package/dist/internal/schema/schema.d.ts.map +1 -1
  112. package/dist/internal/schema/schema.js +21 -8
  113. package/dist/internal/schema/schema.js.map +1 -1
  114. package/dist/testing/TestSchema.d.ts +3 -3
  115. package/dist/testing/TestSchema.js +1 -1
  116. package/dist/unstable/ai/AiError.d.ts +1 -1
  117. package/dist/unstable/ai/AiError.js +1 -1
  118. package/dist/unstable/ai/Chat.d.ts +1 -1
  119. package/dist/unstable/ai/Chat.js +1 -1
  120. package/dist/unstable/cli/Prompt.js +2 -2
  121. package/dist/unstable/cli/Prompt.js.map +1 -1
  122. package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
  123. package/dist/unstable/httpapi/HttpApiSchema.d.ts +39 -0
  124. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  125. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  126. package/dist/unstable/rpc/Rpc.d.ts +1 -1
  127. package/dist/unstable/rpc/Rpc.js +1 -1
  128. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  129. package/dist/unstable/rpc/RpcGroup.js +3 -4
  130. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  131. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  132. package/dist/unstable/sql/SqlResolver.js +15 -2
  133. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  134. package/dist/unstable/workflow/Activity.d.ts +1 -0
  135. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  136. package/dist/unstable/workflow/Activity.js +1 -0
  137. package/dist/unstable/workflow/Activity.js.map +1 -1
  138. package/dist/unstable/workflow/WorkflowEngine.js +1 -1
  139. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  140. package/package.json +1 -1
  141. package/src/Array.ts +65 -65
  142. package/src/Cache.ts +1 -1
  143. package/src/Cause.ts +68 -68
  144. package/src/Channel.ts +5 -5
  145. package/src/Clock.ts +1 -1
  146. package/src/Combiner.ts +9 -9
  147. package/src/Config.ts +40 -108
  148. package/src/ConfigProvider.ts +139 -100
  149. package/src/Console.ts +1 -1
  150. package/src/Data.ts +15 -15
  151. package/src/DateTime.ts +6 -6
  152. package/src/Duration.ts +3 -3
  153. package/src/Effect.ts +89 -45
  154. package/src/Equal.ts +7 -7
  155. package/src/Equivalence.ts +17 -17
  156. package/src/Exit.ts +3 -3
  157. package/src/Formatter.ts +5 -5
  158. package/src/Function.ts +10 -10
  159. package/src/HashMap.ts +3 -3
  160. package/src/Iterable.ts +6 -6
  161. package/src/JsonPatch.ts +2 -2
  162. package/src/Layer.ts +1 -1
  163. package/src/Logger.ts +1 -1
  164. package/src/Match.ts +8 -8
  165. package/src/Metric.ts +3 -3
  166. package/src/Optic.ts +30 -30
  167. package/src/Option.ts +7 -7
  168. package/src/Order.ts +23 -23
  169. package/src/Pool.ts +1 -1
  170. package/src/Predicate.ts +88 -88
  171. package/src/PubSub.ts +3 -3
  172. package/src/Reducer.ts +1 -1
  173. package/src/Result.ts +20 -20
  174. package/src/Runtime.ts +1 -1
  175. package/src/Schema.ts +314 -131
  176. package/src/SchemaAST.ts +20 -11
  177. package/src/SchemaGetter.ts +48 -48
  178. package/src/SchemaIssue.ts +3 -3
  179. package/src/SchemaParser.ts +197 -58
  180. package/src/SchemaRepresentation.ts +73 -3
  181. package/src/SchemaTransformation.ts +20 -20
  182. package/src/Stream.ts +4 -4
  183. package/src/String.ts +1 -1
  184. package/src/Struct.ts +1 -1
  185. package/src/Types.ts +13 -13
  186. package/src/internal/effect.ts +29 -10
  187. package/src/internal/schema/cause.ts +26 -0
  188. package/src/internal/schema/schema.ts +36 -10
  189. package/src/testing/TestSchema.ts +3 -3
  190. package/src/unstable/ai/AiError.ts +1 -1
  191. package/src/unstable/ai/Chat.ts +1 -1
  192. package/src/unstable/cli/Prompt.ts +1 -1
  193. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  194. package/src/unstable/httpapi/HttpApiSchema.ts +18 -6
  195. package/src/unstable/rpc/Rpc.ts +1 -1
  196. package/src/unstable/rpc/RpcGroup.ts +3 -4
  197. package/src/unstable/sql/SqlResolver.ts +15 -2
  198. package/src/unstable/workflow/Activity.ts +2 -0
  199. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/dist/Array.js CHANGED
@@ -29,7 +29,7 @@ import * as Tuple from "./Tuple.js";
29
29
  * Use to access native JavaScript array constructor methods such as `isArray`
30
30
  * or `from` from the Effect module namespace.
31
31
  *
32
- * **Example** (Using the Array constructor)
32
+ * **Example** (Accessing the Array constructor)
33
33
  *
34
34
  * ```ts
35
35
  * import { Array } from "effect"
@@ -259,7 +259,7 @@ export const ensure = self => Array.isArray(self) ? self : [self];
259
259
  * Key order follows `Object.entries` semantics. Empty records produce an empty
260
260
  * array.
261
261
  *
262
- * **Example** (Record to entries)
262
+ * **Example** (Converting a record to entries)
263
263
  *
264
264
  * ```ts
265
265
  * import { Array } from "effect"
@@ -282,7 +282,7 @@ export const fromRecord = Record.toEntries;
282
282
  *
283
283
  * Use to convert a single `Option` into an array for downstream array operations.
284
284
  *
285
- * **Example** (Option to array)
285
+ * **Example** (Converting an Option to an array)
286
286
  *
287
287
  * ```ts
288
288
  * import { Array, Option } from "effect"
@@ -345,7 +345,7 @@ export const match = /*#__PURE__*/dual(2, (self, {
345
345
  *
346
346
  * `onNonEmpty` receives `(head, tail)` where `tail` is the rest of the array.
347
347
  *
348
- * **Example** (Head and tail destructuring)
348
+ * **Example** (Destructuring head and tail)
349
349
  *
350
350
  * ```ts
351
351
  * import { Array } from "effect"
@@ -381,7 +381,7 @@ export const matchLeft = /*#__PURE__*/dual(2, (self, {
381
381
  *
382
382
  * `onNonEmpty` receives `(init, last)` where `init` is everything but the last element.
383
383
  *
384
- * **Example** (Init and last destructuring)
384
+ * **Example** (Destructuring init and last)
385
385
  *
386
386
  * ```ts
387
387
  * import { Array } from "effect"
@@ -557,7 +557,7 @@ export const scan = /*#__PURE__*/dual(3, (self, b, f) => {
557
557
  * The output length is `input.length + 1` because it ends with the initial
558
558
  * value. The result is always a `NonEmptyArray`.
559
559
  *
560
- * **Example** (Reverse running totals)
560
+ * **Example** (Scanning running totals in reverse)
561
561
  *
562
562
  * ```ts
563
563
  * import { Array } from "effect"
@@ -734,7 +734,7 @@ const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
734
734
  *
735
735
  * The index is floored to an integer. This never throws.
736
736
  *
737
- * **Example** (Safe index access)
737
+ * **Example** (Accessing indexes safely)
738
738
  *
739
739
  * ```ts
740
740
  * import { Array } from "effect"
@@ -767,7 +767,7 @@ export const get = /*#__PURE__*/dual(2, (self, index) => {
767
767
  * Throws an `Error` with the message `"Index out of bounds: <i>"`. Prefer
768
768
  * `get` for safe access.
769
769
  *
770
- * **Example** (Unsafe index access)
770
+ * **Example** (Accessing indexes unsafely)
771
771
  *
772
772
  * ```ts
773
773
  * import { Array } from "effect"
@@ -1764,7 +1764,7 @@ export const sortWith = /*#__PURE__*/dual(3, (self, f, order) => Array.from(self
1764
1764
  * This is data-last only and returns a function. The return type preserves
1765
1765
  * `NonEmptyArray`.
1766
1766
  *
1767
- * **Example** (Multi-key sorting)
1767
+ * **Example** (Sorting by multiple keys)
1768
1768
  *
1769
1769
  * ```ts
1770
1770
  * import { Array, Order, pipe } from "effect"
@@ -2080,7 +2080,7 @@ export const rotate = /*#__PURE__*/dual(2, (self, n) => {
2080
2080
  * Use when checking membership with caller-provided equality instead of
2081
2081
  * `Equal.equivalence()`.
2082
2082
  *
2083
- * **Example** (Custom equality check)
2083
+ * **Example** (Checking with custom equality)
2084
2084
  *
2085
2085
  * ```ts
2086
2086
  * import { Array, pipe } from "effect"
@@ -2397,7 +2397,7 @@ export const chunksOf = /*#__PURE__*/dual(2, (self, n) => {
2397
2397
  * Returns an empty array if `n <= 0` or the array has fewer than `n` elements.
2398
2398
  * Each window is a tuple of exactly `n` elements.
2399
2399
  *
2400
- * **Example** (Sliding windows)
2400
+ * **Example** (Creating sliding windows)
2401
2401
  *
2402
2402
  * ```ts
2403
2403
  * import { Array } from "effect"
@@ -2545,7 +2545,7 @@ export const groupBy = /*#__PURE__*/dual(2, (self, f) => {
2545
2545
  * Use when you need the union of two arrays but duplicate detection must use a
2546
2546
  * custom equivalence instead of the default `Equal.equivalence()`.
2547
2547
  *
2548
- * **Example** (Union with custom equality)
2548
+ * **Example** (Computing unions with custom equality)
2549
2549
  *
2550
2550
  * ```ts
2551
2551
  * import { Array } from "effect"
@@ -2576,7 +2576,7 @@ export const unionWith = /*#__PURE__*/dual(3, (self, that, isEquivalent) => {
2576
2576
  * Computes the union of two arrays, removing duplicates using
2577
2577
  * `Equal.equivalence()`.
2578
2578
  *
2579
- * **Example** (Array union)
2579
+ * **Example** (Computing array unions)
2580
2580
  *
2581
2581
  * ```ts
2582
2582
  * import { Array } from "effect"
@@ -2601,7 +2601,7 @@ export const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that,
2601
2601
  * Use when you need to keep only values present in both arrays and equality
2602
2602
  * must be defined by a custom comparator, such as matching objects by id.
2603
2603
  *
2604
- * **Example** (Intersection with custom equality)
2604
+ * **Example** (Computing intersections with custom equality)
2605
2605
  *
2606
2606
  * ```ts
2607
2607
  * import { Array } from "effect"
@@ -2635,7 +2635,7 @@ export const intersectionWith = isEquivalent => {
2635
2635
  * Use when Effect equality is the right membership test and you want to keep
2636
2636
  * values present in both inputs while preserving the first input's order.
2637
2637
  *
2638
- * **Example** (Array intersection)
2638
+ * **Example** (Computing array intersections)
2639
2639
  *
2640
2640
  * ```ts
2641
2641
  * import { Array } from "effect"
@@ -2660,7 +2660,7 @@ export const intersection = /*#__PURE__*/intersectionWith(/*#__PURE__*/Equal.asE
2660
2660
  * Use when you need to keep only values from the first array and equality must
2661
2661
  * be defined by a custom comparator, such as matching objects by id.
2662
2662
  *
2663
- * **Example** (Difference with custom equality)
2663
+ * **Example** (Computing differences with custom equality)
2664
2664
  *
2665
2665
  * ```ts
2666
2666
  * import { Array } from "effect"
@@ -2692,7 +2692,7 @@ export const differenceWith = isEquivalent => {
2692
2692
  * Use when you need to keep values from the first array that are absent from
2693
2693
  * the second and the default `Equal.equivalence()` comparison is appropriate.
2694
2694
  *
2695
- * **Example** (Array difference)
2695
+ * **Example** (Computing array differences)
2696
2696
  *
2697
2697
  * ```ts
2698
2698
  * import { Array } from "effect"
@@ -2788,7 +2788,7 @@ export const map = /*#__PURE__*/dual(2, (self, f) => self.map(f));
2788
2788
  * The function receives `(element, index)`. This returns `NonEmptyArray` when
2789
2789
  * both the input and mapped arrays are non-empty.
2790
2790
  *
2791
- * **Example** (FlatMapping an array)
2791
+ * **Example** (Flat mapping an array)
2792
2792
  *
2793
2793
  * ```ts
2794
2794
  * import { Array } from "effect"
@@ -2946,7 +2946,7 @@ export const getSuccesses = self => {
2946
2946
  *
2947
2947
  * The filter receives `(element, index)`. Failures are discarded.
2948
2948
  *
2949
- * **Example** (Filter and transform)
2949
+ * **Example** (Filtering and transforming)
2950
2950
  *
2951
2951
  * ```ts
2952
2952
  * import { Array, Result } from "effect"
@@ -3122,7 +3122,7 @@ export const reduce = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(self).re
3122
3122
  *
3123
3123
  * The function receives `(accumulator, element, index)`.
3124
3124
  *
3125
- * **Example** (Right-to-left fold)
3125
+ * **Example** (Folding from right to left)
3126
3126
  *
3127
3127
  * ```ts
3128
3128
  * import { Array } from "effect"
@@ -3141,7 +3141,7 @@ export const reduceRight = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(sel
3141
3141
  * Lifts a predicate into an array: returns `[value]` if the predicate holds,
3142
3142
  * `[]` otherwise.
3143
3143
  *
3144
- * **Example** (Conditional wrapping)
3144
+ * **Example** (Wrapping values conditionally)
3145
3145
  *
3146
3146
  * ```ts
3147
3147
  * import { Array } from "effect"
@@ -3195,7 +3195,7 @@ export const liftOption = f => (...a) => fromOption(f(...a));
3195
3195
  *
3196
3196
  * Use to treat a nullable single value as zero or one array element.
3197
3197
  *
3198
- * **Example** (Nullable to array)
3198
+ * **Example** (Converting nullable values to an array)
3199
3199
  *
3200
3200
  * ```ts
3201
3201
  * import { Array } from "effect"
@@ -3245,7 +3245,7 @@ export const liftNullishOr = f => (...a) => fromNullishOr(f(...a));
3245
3245
  * Use when you need to map and filter in one step, where the mapper can return
3246
3246
  * `null` or `undefined` to skip elements.
3247
3247
  *
3248
- * **Example** (FlatMapping with nullable)
3248
+ * **Example** (Flat mapping with nullable values)
3249
3249
  *
3250
3250
  * ```ts
3251
3251
  * import { Array } from "effect"
@@ -3352,7 +3352,7 @@ export const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicat
3352
3352
  *
3353
3353
  * For index `i`, the function receives `self.slice(i)`.
3354
3354
  *
3355
- * **Example** (Suffix lengths)
3355
+ * **Example** (Computing suffix lengths)
3356
3356
  *
3357
3357
  * ```ts
3358
3358
  * import { Array } from "effect"
@@ -3723,7 +3723,7 @@ export const cartesianWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(sel
3723
3723
  * Produces every `[a, b]` combination of an element from `self` with an element
3724
3724
  * from `that`, so the result length is `self.length * that.length`.
3725
3725
  *
3726
- * **Example** (All pairs of two arrays)
3726
+ * **Example** (Generating all pairs from two arrays)
3727
3727
  *
3728
3728
  * ```ts
3729
3729
  * import { Array } from "effect"
@@ -3755,7 +3755,7 @@ export const cartesian = /*#__PURE__*/dual(2, (self, that) => cartesianWith(self
3755
3755
  * like nested loops. Use `filter` and `map` in the pipeline to add conditions
3756
3756
  * and transformations.
3757
3757
  *
3758
- * **Example** (Array comprehension with do notation)
3758
+ * **Example** (Building array comprehensions with do notation)
3759
3759
  *
3760
3760
  * ```ts
3761
3761
  * import { Array, pipe } from "effect"
package/dist/Cache.d.ts CHANGED
@@ -123,7 +123,7 @@ export interface Entry<A, E> {
123
123
  * The timeToLive function receives both the exit result and the key, allowing
124
124
  * for flexible TTL policies based on success/failure state and key characteristics.
125
125
  *
126
- * **Example** (Using dynamic time to live)
126
+ * **Example** (Configuring dynamic time to live)
127
127
  *
128
128
  * ```ts
129
129
  * import { Cache, Effect, Exit } from "effect"
package/dist/Cache.js CHANGED
@@ -33,7 +33,7 @@ const TypeId = "~effect/Cache";
33
33
  * The timeToLive function receives both the exit result and the key, allowing
34
34
  * for flexible TTL policies based on success/failure state and key characteristics.
35
35
  *
36
- * **Example** (Using dynamic time to live)
36
+ * **Example** (Configuring dynamic time to live)
37
37
  *
38
38
  * ```ts
39
39
  * import { Cache, Effect, Exit } from "effect"