effect 4.0.0-beta.83 → 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 (195) 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/rpc/Rpc.d.ts +1 -1
  124. package/dist/unstable/rpc/Rpc.js +1 -1
  125. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  126. package/dist/unstable/rpc/RpcGroup.js +3 -4
  127. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  128. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  129. package/dist/unstable/sql/SqlResolver.js +15 -2
  130. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  131. package/dist/unstable/workflow/Activity.d.ts +1 -0
  132. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  133. package/dist/unstable/workflow/Activity.js +1 -0
  134. package/dist/unstable/workflow/Activity.js.map +1 -1
  135. package/dist/unstable/workflow/WorkflowEngine.js +1 -1
  136. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  137. package/package.json +1 -1
  138. package/src/Array.ts +65 -65
  139. package/src/Cache.ts +1 -1
  140. package/src/Cause.ts +68 -68
  141. package/src/Channel.ts +5 -5
  142. package/src/Clock.ts +1 -1
  143. package/src/Combiner.ts +9 -9
  144. package/src/Config.ts +40 -108
  145. package/src/ConfigProvider.ts +139 -100
  146. package/src/Console.ts +1 -1
  147. package/src/Data.ts +15 -15
  148. package/src/DateTime.ts +6 -6
  149. package/src/Duration.ts +3 -3
  150. package/src/Effect.ts +89 -45
  151. package/src/Equal.ts +7 -7
  152. package/src/Equivalence.ts +17 -17
  153. package/src/Exit.ts +3 -3
  154. package/src/Formatter.ts +5 -5
  155. package/src/Function.ts +10 -10
  156. package/src/HashMap.ts +3 -3
  157. package/src/Iterable.ts +6 -6
  158. package/src/JsonPatch.ts +2 -2
  159. package/src/Layer.ts +1 -1
  160. package/src/Logger.ts +1 -1
  161. package/src/Match.ts +8 -8
  162. package/src/Metric.ts +3 -3
  163. package/src/Optic.ts +30 -30
  164. package/src/Option.ts +7 -7
  165. package/src/Order.ts +23 -23
  166. package/src/Pool.ts +1 -1
  167. package/src/Predicate.ts +88 -88
  168. package/src/PubSub.ts +3 -3
  169. package/src/Reducer.ts +1 -1
  170. package/src/Result.ts +20 -20
  171. package/src/Runtime.ts +1 -1
  172. package/src/Schema.ts +314 -131
  173. package/src/SchemaAST.ts +20 -11
  174. package/src/SchemaGetter.ts +48 -48
  175. package/src/SchemaIssue.ts +3 -3
  176. package/src/SchemaParser.ts +197 -58
  177. package/src/SchemaRepresentation.ts +73 -3
  178. package/src/SchemaTransformation.ts +20 -20
  179. package/src/Stream.ts +4 -4
  180. package/src/String.ts +1 -1
  181. package/src/Struct.ts +1 -1
  182. package/src/Types.ts +13 -13
  183. package/src/internal/effect.ts +29 -10
  184. package/src/internal/schema/cause.ts +26 -0
  185. package/src/internal/schema/schema.ts +36 -10
  186. package/src/testing/TestSchema.ts +3 -3
  187. package/src/unstable/ai/AiError.ts +1 -1
  188. package/src/unstable/ai/Chat.ts +1 -1
  189. package/src/unstable/cli/Prompt.ts +1 -1
  190. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  191. package/src/unstable/rpc/Rpc.ts +1 -1
  192. package/src/unstable/rpc/RpcGroup.ts +3 -4
  193. package/src/unstable/sql/SqlResolver.ts +15 -2
  194. package/src/unstable/workflow/Activity.ts +2 -0
  195. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/src/PubSub.ts CHANGED
@@ -768,7 +768,7 @@ export const shutdown = <A>(self: PubSub<A>): Effect.Effect<void> =>
768
768
  * Checks effectfully whether `shutdown` has been called, returning `true`
769
769
  * after shutdown and `false` otherwise.
770
770
  *
771
- * **Example** (Checking whether a PubSub is shutdown)
771
+ * **Example** (Checking whether a PubSub is shut down)
772
772
  *
773
773
  * ```ts
774
774
  * import { Effect, PubSub } from "effect"
@@ -2867,7 +2867,7 @@ export class BackPressureStrategy<in out A> implements PubSub.Strategy<A> {
2867
2867
  *
2868
2868
  * Subscribers may miss messages published while they are subscribed.
2869
2869
  *
2870
- * **Example** (Using a dropping strategy)
2870
+ * **Example** (Applying a dropping strategy)
2871
2871
  *
2872
2872
  * ```ts
2873
2873
  * import { Effect, PubSub } from "effect"
@@ -2954,7 +2954,7 @@ export class DroppingStrategy<in out A> implements PubSub.Strategy<A> {
2954
2954
  * Slow subscribers may miss older messages that are evicted before they are
2955
2955
  * consumed.
2956
2956
  *
2957
- * **Example** (Using a sliding strategy)
2957
+ * **Example** (Applying a sliding strategy)
2958
2958
  *
2959
2959
  * ```ts
2960
2960
  * import { Effect, PubSub } from "effect"
package/src/Reducer.ts CHANGED
@@ -87,7 +87,7 @@ export interface Reducer<A> extends Combiner.Combiner<A> {
87
87
  * `initialValue` is used.
88
88
  * - If `combineAll` is provided, it completely replaces the default fold.
89
89
  *
90
- * **Example** (Multiplication with short-circuit)
90
+ * **Example** (Multiplying with short-circuit)
91
91
  *
92
92
  * ```ts
93
93
  * import { Reducer } from "effect"
package/src/Result.ts CHANGED
@@ -328,7 +328,7 @@ export {
328
328
  * This is equivalent to `Result.succeed(undefined)`, but reuses a shared
329
329
  * `Success` wrapper instead of allocating one each time.
330
330
  *
331
- * **Example** (Using void result)
331
+ * **Example** (Referencing void results)
332
332
  *
333
333
  * ```ts
334
334
  * import { Result } from "effect"
@@ -361,7 +361,7 @@ export {
361
361
  * `Result<never, void>`, but reuses a shared `Failure` wrapper instead of
362
362
  * allocating one each time.
363
363
  *
364
- * **Example** (Using a failure without a payload)
364
+ * **Example** (Failing without a payload)
365
365
  *
366
366
  * ```ts
367
367
  * import { Result } from "effect"
@@ -706,7 +706,7 @@ export const isResult: (input: unknown) => input is Result<unknown, unknown> = r
706
706
  * - Acts as a TypeScript type guard, narrowing to `Failure<A, E>`
707
707
  * - After narrowing, you can access `.failure` to read the error value
708
708
  *
709
- * **Example** (Narrowing to Failure)
709
+ * **Example** (Narrowing to failure)
710
710
  *
711
711
  * ```ts
712
712
  * import { Result } from "effect"
@@ -739,7 +739,7 @@ export const isFailure: <A, E>(self: Result<A, E>) => self is Failure<A, E> = re
739
739
  * - Acts as a TypeScript type guard, narrowing to `Success<A, E>`
740
740
  * - After narrowing, you can access `.success` to read the value
741
741
  *
742
- * **Example** (Narrowing to Success)
742
+ * **Example** (Narrowing to success)
743
743
  *
744
744
  * ```ts
745
745
  * import { Result } from "effect"
@@ -2231,7 +2231,7 @@ export const orElse: {
2231
2231
  * - The error types are merged into a union (`E | E2`)
2232
2232
  * - This is the monadic `bind` / `>>=` for `Result`
2233
2233
  *
2234
- * **Example** (Sequential validation)
2234
+ * **Example** (Validating sequentially)
2235
2235
  *
2236
2236
  * ```ts
2237
2237
  * import { pipe, Result } from "effect"
@@ -2268,7 +2268,7 @@ export const flatMap: {
2268
2268
  * - The error types are merged into a union (`E | E2`)
2269
2269
  * - This is the monadic `bind` / `>>=` for `Result`
2270
2270
  *
2271
- * **Example** (Sequential validation)
2271
+ * **Example** (Validating sequentially)
2272
2272
  *
2273
2273
  * ```ts
2274
2274
  * import { pipe, Result } from "effect"
@@ -2305,7 +2305,7 @@ export const flatMap: {
2305
2305
  * - The error types are merged into a union (`E | E2`)
2306
2306
  * - This is the monadic `bind` / `>>=` for `Result`
2307
2307
  *
2308
- * **Example** (Sequential validation)
2308
+ * **Example** (Validating sequentially)
2309
2309
  *
2310
2310
  * ```ts
2311
2311
  * import { pipe, Result } from "effect"
@@ -2351,7 +2351,7 @@ export const flatMap: {
2351
2351
  *
2352
2352
  * If `self` is a `Failure`, the second argument is never evaluated.
2353
2353
  *
2354
- * **Example** (Using andThen with different argument types)
2354
+ * **Example** (Chaining Result values with different argument types)
2355
2355
  *
2356
2356
  * ```ts
2357
2357
  * import { pipe, Result } from "effect"
@@ -2399,7 +2399,7 @@ export const andThen: {
2399
2399
  *
2400
2400
  * If `self` is a `Failure`, the second argument is never evaluated.
2401
2401
  *
2402
- * **Example** (Using andThen with different argument types)
2402
+ * **Example** (Chaining Result values with different argument types)
2403
2403
  *
2404
2404
  * ```ts
2405
2405
  * import { pipe, Result } from "effect"
@@ -2447,7 +2447,7 @@ export const andThen: {
2447
2447
  *
2448
2448
  * If `self` is a `Failure`, the second argument is never evaluated.
2449
2449
  *
2450
- * **Example** (Using andThen with different argument types)
2450
+ * **Example** (Chaining Result values with different argument types)
2451
2451
  *
2452
2452
  * ```ts
2453
2453
  * import { pipe, Result } from "effect"
@@ -2495,7 +2495,7 @@ export const andThen: {
2495
2495
  *
2496
2496
  * If `self` is a `Failure`, the second argument is never evaluated.
2497
2497
  *
2498
- * **Example** (Using andThen with different argument types)
2498
+ * **Example** (Chaining Result values with different argument types)
2499
2499
  *
2500
2500
  * ```ts
2501
2501
  * import { pipe, Result } from "effect"
@@ -2543,7 +2543,7 @@ export const andThen: {
2543
2543
  *
2544
2544
  * If `self` is a `Failure`, the second argument is never evaluated.
2545
2545
  *
2546
- * **Example** (Using andThen with different argument types)
2546
+ * **Example** (Chaining Result values with different argument types)
2547
2547
  *
2548
2548
  * ```ts
2549
2549
  * import { pipe, Result } from "effect"
@@ -2591,7 +2591,7 @@ export const andThen: {
2591
2591
  *
2592
2592
  * If `self` is a `Failure`, the second argument is never evaluated.
2593
2593
  *
2594
- * **Example** (Using andThen with different argument types)
2594
+ * **Example** (Chaining Result values with different argument types)
2595
2595
  *
2596
2596
  * ```ts
2597
2597
  * import { pipe, Result } from "effect"
@@ -2639,7 +2639,7 @@ export const andThen: {
2639
2639
  *
2640
2640
  * If `self` is a `Failure`, the second argument is never evaluated.
2641
2641
  *
2642
- * **Example** (Using andThen with different argument types)
2642
+ * **Example** (Chaining Result values with different argument types)
2643
2643
  *
2644
2644
  * ```ts
2645
2645
  * import { pipe, Result } from "effect"
@@ -2687,7 +2687,7 @@ export const andThen: {
2687
2687
  *
2688
2688
  * If `self` is a `Failure`, the second argument is never evaluated.
2689
2689
  *
2690
- * **Example** (Using andThen with different argument types)
2690
+ * **Example** (Chaining Result values with different argument types)
2691
2691
  *
2692
2692
  * ```ts
2693
2693
  * import { pipe, Result } from "effect"
@@ -2735,7 +2735,7 @@ export const andThen: {
2735
2735
  *
2736
2736
  * If `self` is a `Failure`, the second argument is never evaluated.
2737
2737
  *
2738
- * **Example** (Using andThen with different argument types)
2738
+ * **Example** (Chaining Result values with different argument types)
2739
2739
  *
2740
2740
  * ```ts
2741
2741
  * import { pipe, Result } from "effect"
@@ -3310,7 +3310,7 @@ export const transposeOption = <A = never, E = never>(
3310
3310
  * - `Some(a)` where `f(a)` is `Success(b)` becomes `Success(Some(b))`
3311
3311
  * - `Some(a)` where `f(a)` is `Failure(e)` becomes `Failure(e)`
3312
3312
  *
3313
- * **Example** (Map and transpose in one step)
3313
+ * **Example** (Mapping and transposing in one step)
3314
3314
  *
3315
3315
  * ```ts
3316
3316
  * import { Option, Result } from "effect"
@@ -3348,7 +3348,7 @@ export const transposeMapOption = dual<
3348
3348
  * - `Some(a)` where `f(a)` is `Success(b)` becomes `Success(Some(b))`
3349
3349
  * - `Some(a)` where `f(a)` is `Failure(e)` becomes `Failure(e)`
3350
3350
  *
3351
- * **Example** (Map and transpose in one step)
3351
+ * **Example** (Mapping and transposing in one step)
3352
3352
  *
3353
3353
  * ```ts
3354
3354
  * import { Option, Result } from "effect"
@@ -3386,7 +3386,7 @@ export const transposeMapOption = dual<
3386
3386
  * - `Some(a)` where `f(a)` is `Success(b)` becomes `Success(Some(b))`
3387
3387
  * - `Some(a)` where `f(a)` is `Failure(e)` becomes `Failure(e)`
3388
3388
  *
3389
- * **Example** (Map and transpose in one step)
3389
+ * **Example** (Mapping and transposing in one step)
3390
3390
  *
3391
3391
  * ```ts
3392
3392
  * import { Option, Result } from "effect"
@@ -3424,7 +3424,7 @@ export const transposeMapOption = dual<
3424
3424
  * This is equivalent to `Result.succeed(Option.none())`, but reuses a shared
3425
3425
  * `Success` wrapper instead of allocating one each time.
3426
3426
  *
3427
- * **Example** (Using succeedNone)
3427
+ * **Example** (Succeeding with None)
3428
3428
  *
3429
3429
  * ```ts
3430
3430
  * import { Result } from "effect"
package/src/Runtime.ts CHANGED
@@ -88,7 +88,7 @@ export interface Teardown {
88
88
  * The `130` code is used only when the Cause contains interruptions and no
89
89
  * other failure reasons. Mixed causes use the squashed error path instead.
90
90
  *
91
- * **Example** (Using default teardown)
91
+ * **Example** (Referencing default teardown)
92
92
  *
93
93
  * ```ts
94
94
  * import { Exit, Runtime } from "effect"