effect 4.0.0-beta.83 → 4.0.0-beta.85

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 (235) 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/Context.d.ts.map +1 -1
  24. package/dist/Context.js +4 -3
  25. package/dist/Context.js.map +1 -1
  26. package/dist/Data.d.ts +15 -15
  27. package/dist/Data.js +3 -3
  28. package/dist/DateTime.d.ts +6 -6
  29. package/dist/DateTime.js +2 -2
  30. package/dist/Duration.d.ts +3 -3
  31. package/dist/Duration.js +3 -3
  32. package/dist/Effect.d.ts +84 -45
  33. package/dist/Effect.d.ts.map +1 -1
  34. package/dist/Effect.js +72 -33
  35. package/dist/Effect.js.map +1 -1
  36. package/dist/Equal.d.ts +7 -7
  37. package/dist/Equal.js +5 -5
  38. package/dist/Equivalence.d.ts +17 -17
  39. package/dist/Equivalence.js +13 -13
  40. package/dist/Exit.d.ts +3 -3
  41. package/dist/Exit.js +3 -3
  42. package/dist/Formatter.d.ts +5 -5
  43. package/dist/Formatter.js +4 -4
  44. package/dist/Function.d.ts +10 -10
  45. package/dist/Function.js +3 -3
  46. package/dist/HashMap.d.ts +3 -3
  47. package/dist/HashMap.js +1 -1
  48. package/dist/Iterable.d.ts +6 -6
  49. package/dist/Iterable.js +2 -2
  50. package/dist/JsonPatch.d.ts +2 -2
  51. package/dist/Layer.d.ts +1 -1
  52. package/dist/Layer.js +5 -4
  53. package/dist/Layer.js.map +1 -1
  54. package/dist/LayerMap.d.ts.map +1 -1
  55. package/dist/LayerMap.js +4 -3
  56. package/dist/LayerMap.js.map +1 -1
  57. package/dist/Logger.d.ts +1 -1
  58. package/dist/Logger.js +1 -1
  59. package/dist/Match.d.ts +8 -8
  60. package/dist/Match.js +8 -8
  61. package/dist/Metric.d.ts +3 -3
  62. package/dist/Metric.js +3 -3
  63. package/dist/Optic.d.ts +30 -30
  64. package/dist/Optic.js +12 -12
  65. package/dist/Option.d.ts +7 -7
  66. package/dist/Option.js +7 -7
  67. package/dist/Order.d.ts +23 -23
  68. package/dist/Order.js +20 -20
  69. package/dist/Pool.d.ts +1 -1
  70. package/dist/Pool.js +1 -1
  71. package/dist/Predicate.d.ts +88 -88
  72. package/dist/Predicate.js +47 -47
  73. package/dist/PubSub.d.ts +3 -3
  74. package/dist/PubSub.js +3 -3
  75. package/dist/Random.d.ts +31 -0
  76. package/dist/Random.d.ts.map +1 -1
  77. package/dist/Random.js +32 -0
  78. package/dist/Random.js.map +1 -1
  79. package/dist/Reducer.d.ts +1 -1
  80. package/dist/Reducer.js +1 -1
  81. package/dist/Result.d.ts +18 -18
  82. package/dist/Result.js +8 -8
  83. package/dist/Runtime.d.ts +1 -1
  84. package/dist/Runtime.js +1 -1
  85. package/dist/Schema.d.ts +313 -126
  86. package/dist/Schema.d.ts.map +1 -1
  87. package/dist/Schema.js +316 -127
  88. package/dist/Schema.js.map +1 -1
  89. package/dist/SchemaAST.d.ts +9 -8
  90. package/dist/SchemaAST.d.ts.map +1 -1
  91. package/dist/SchemaAST.js +203 -140
  92. package/dist/SchemaAST.js.map +1 -1
  93. package/dist/SchemaGetter.d.ts +48 -48
  94. package/dist/SchemaGetter.js +44 -44
  95. package/dist/SchemaIssue.d.ts +3 -3
  96. package/dist/SchemaIssue.js +3 -3
  97. package/dist/SchemaParser.d.ts +122 -22
  98. package/dist/SchemaParser.d.ts.map +1 -1
  99. package/dist/SchemaParser.js +186 -50
  100. package/dist/SchemaParser.js.map +1 -1
  101. package/dist/SchemaRepresentation.d.ts +1 -1
  102. package/dist/SchemaRepresentation.d.ts.map +1 -1
  103. package/dist/SchemaRepresentation.js +96 -2
  104. package/dist/SchemaRepresentation.js.map +1 -1
  105. package/dist/SchemaTransformation.d.ts +20 -20
  106. package/dist/SchemaTransformation.js +18 -18
  107. package/dist/Stream.d.ts +3 -3
  108. package/dist/Stream.js +2 -2
  109. package/dist/Stream.js.map +1 -1
  110. package/dist/String.d.ts +1 -1
  111. package/dist/String.js +1 -1
  112. package/dist/Struct.d.ts +1 -1
  113. package/dist/Struct.js +1 -1
  114. package/dist/Types.d.ts +13 -13
  115. package/dist/internal/effect.js +33 -20
  116. package/dist/internal/effect.js.map +1 -1
  117. package/dist/internal/schema/arbitrary.js +17 -1
  118. package/dist/internal/schema/arbitrary.js.map +1 -1
  119. package/dist/internal/schema/cause.d.ts +2 -0
  120. package/dist/internal/schema/cause.d.ts.map +1 -0
  121. package/dist/internal/schema/cause.js +24 -0
  122. package/dist/internal/schema/cause.js.map +1 -0
  123. package/dist/internal/schema/schema.d.ts +8 -4
  124. package/dist/internal/schema/schema.d.ts.map +1 -1
  125. package/dist/internal/schema/schema.js +21 -8
  126. package/dist/internal/schema/schema.js.map +1 -1
  127. package/dist/internal/stackTraceLimit.d.ts +2 -0
  128. package/dist/internal/stackTraceLimit.d.ts.map +1 -0
  129. package/dist/internal/stackTraceLimit.js +40 -0
  130. package/dist/internal/stackTraceLimit.js.map +1 -0
  131. package/dist/internal/tracer.d.ts.map +1 -1
  132. package/dist/internal/tracer.js +4 -3
  133. package/dist/internal/tracer.js.map +1 -1
  134. package/dist/testing/TestSchema.d.ts +3 -3
  135. package/dist/testing/TestSchema.js +1 -1
  136. package/dist/unstable/ai/AiError.d.ts +1 -1
  137. package/dist/unstable/ai/AiError.js +1 -1
  138. package/dist/unstable/ai/Chat.d.ts +1 -1
  139. package/dist/unstable/ai/Chat.js +1 -1
  140. package/dist/unstable/ai/Tool.d.ts.map +1 -1
  141. package/dist/unstable/ai/Tool.js +4 -5
  142. package/dist/unstable/ai/Tool.js.map +1 -1
  143. package/dist/unstable/cli/Prompt.js +2 -2
  144. package/dist/unstable/cli/Prompt.js.map +1 -1
  145. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  146. package/dist/unstable/httpapi/HttpApiMiddleware.js +4 -3
  147. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  148. package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
  149. package/dist/unstable/persistence/PersistedQueue.js +1 -1
  150. package/dist/unstable/rpc/Rpc.d.ts +1 -1
  151. package/dist/unstable/rpc/Rpc.js +1 -1
  152. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  153. package/dist/unstable/rpc/RpcGroup.js +3 -4
  154. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  155. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  156. package/dist/unstable/rpc/RpcMiddleware.js +4 -3
  157. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  158. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  159. package/dist/unstable/sql/SqlResolver.js +15 -2
  160. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  161. package/dist/unstable/workflow/Activity.d.ts +1 -0
  162. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  163. package/dist/unstable/workflow/Activity.js +1 -0
  164. package/dist/unstable/workflow/Activity.js.map +1 -1
  165. package/dist/unstable/workflow/WorkflowEngine.js +1 -1
  166. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  167. package/package.json +1 -1
  168. package/src/Array.ts +65 -65
  169. package/src/Cache.ts +1 -1
  170. package/src/Cause.ts +68 -68
  171. package/src/Channel.ts +5 -5
  172. package/src/Clock.ts +1 -1
  173. package/src/Combiner.ts +9 -9
  174. package/src/Config.ts +40 -108
  175. package/src/ConfigProvider.ts +139 -100
  176. package/src/Console.ts +1 -1
  177. package/src/Context.ts +4 -5
  178. package/src/Data.ts +15 -15
  179. package/src/DateTime.ts +6 -6
  180. package/src/Duration.ts +3 -3
  181. package/src/Effect.ts +89 -45
  182. package/src/Equal.ts +7 -7
  183. package/src/Equivalence.ts +17 -17
  184. package/src/Exit.ts +3 -3
  185. package/src/Formatter.ts +5 -5
  186. package/src/Function.ts +10 -10
  187. package/src/HashMap.ts +3 -3
  188. package/src/Iterable.ts +6 -6
  189. package/src/JsonPatch.ts +2 -2
  190. package/src/Layer.ts +5 -5
  191. package/src/LayerMap.ts +4 -3
  192. package/src/Logger.ts +1 -1
  193. package/src/Match.ts +8 -8
  194. package/src/Metric.ts +3 -3
  195. package/src/Optic.ts +30 -30
  196. package/src/Option.ts +7 -7
  197. package/src/Order.ts +23 -23
  198. package/src/Pool.ts +1 -1
  199. package/src/Predicate.ts +88 -88
  200. package/src/PubSub.ts +3 -3
  201. package/src/Random.ts +42 -0
  202. package/src/Reducer.ts +1 -1
  203. package/src/Result.ts +20 -20
  204. package/src/Runtime.ts +1 -1
  205. package/src/Schema.ts +389 -153
  206. package/src/SchemaAST.ts +237 -148
  207. package/src/SchemaGetter.ts +48 -48
  208. package/src/SchemaIssue.ts +3 -3
  209. package/src/SchemaParser.ts +197 -58
  210. package/src/SchemaRepresentation.ts +73 -3
  211. package/src/SchemaTransformation.ts +20 -20
  212. package/src/Stream.ts +4 -4
  213. package/src/String.ts +1 -1
  214. package/src/Struct.ts +1 -1
  215. package/src/Types.ts +13 -13
  216. package/src/internal/effect.ts +40 -21
  217. package/src/internal/schema/arbitrary.ts +23 -2
  218. package/src/internal/schema/cause.ts +26 -0
  219. package/src/internal/schema/schema.ts +36 -10
  220. package/src/internal/stackTraceLimit.ts +63 -0
  221. package/src/internal/tracer.ts +4 -3
  222. package/src/testing/TestSchema.ts +3 -3
  223. package/src/unstable/ai/AiError.ts +1 -1
  224. package/src/unstable/ai/Chat.ts +1 -1
  225. package/src/unstable/ai/Tool.ts +4 -3
  226. package/src/unstable/cli/Prompt.ts +1 -1
  227. package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -3
  228. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  229. package/src/unstable/persistence/PersistedQueue.ts +1 -1
  230. package/src/unstable/rpc/Rpc.ts +1 -1
  231. package/src/unstable/rpc/RpcGroup.ts +3 -4
  232. package/src/unstable/rpc/RpcMiddleware.ts +4 -3
  233. package/src/unstable/sql/SqlResolver.ts +15 -2
  234. package/src/unstable/workflow/Activity.ts +2 -0
  235. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/src/Order.ts CHANGED
@@ -29,7 +29,7 @@ import * as Reducer from "./Reducer.ts"
29
29
  * is greater than the second. It must satisfy total ordering laws: totality,
30
30
  * antisymmetry, and transitivity.
31
31
  *
32
- * **Example** (Custom Order)
32
+ * **Example** (Defining a custom Order)
33
33
  *
34
34
  * ```ts
35
35
  * import { Order } from "effect"
@@ -126,7 +126,7 @@ export function make<A>(
126
126
  * Uses lexicographic dictionary ordering. The empty string is less than any
127
127
  * non-empty string, and comparisons are case-sensitive.
128
128
  *
129
- * **Example** (String Ordering)
129
+ * **Example** (Ordering strings)
130
130
  *
131
131
  * ```ts
132
132
  * import { Order } from "effect"
@@ -156,7 +156,7 @@ export const String: Order<string> = make((self, that) => self < that ? -1 : 1)
156
156
  * each other, and any `NaN` is considered less than any non-`NaN` number. All
157
157
  * other values use standard numeric comparison.
158
158
  *
159
- * **Example** (Number Ordering)
159
+ * **Example** (Ordering numbers)
160
160
  *
161
161
  * ```ts
162
162
  * import { Order } from "effect"
@@ -192,7 +192,7 @@ export const Number: Order<number> = make((self, that) => {
192
192
  *
193
193
  * `false` is less than `true`, and equal values return `0`.
194
194
  *
195
- * **Example** (Boolean Ordering)
195
+ * **Example** (Ordering booleans)
196
196
  *
197
197
  * ```ts
198
198
  * import { Order } from "effect"
@@ -220,7 +220,7 @@ export const Boolean: Order<boolean> = make((self, that) => self < that ? -1 : 1
220
220
  * Uses standard numeric comparison for bigint values and handles arbitrarily
221
221
  * large integers.
222
222
  *
223
- * **Example** (BigInt Ordering)
223
+ * **Example** (Ordering BigInts)
224
224
  *
225
225
  * ```ts
226
226
  * import { Order } from "effect"
@@ -250,7 +250,7 @@ export const BigInt: Order<bigint> = make((self, that) => self < that ? -1 : 1)
250
250
  * original order returns `-1`, the flipped order returns `1`, and vice versa.
251
251
  * Equal comparisons remain `0`.
252
252
  *
253
- * **Example** (Reversing Order)
253
+ * **Example** (Reversing an Order)
254
254
  *
255
255
  * ```ts
256
256
  * import { Order } from "effect"
@@ -284,7 +284,7 @@ export function flip<A>(O: Order<A>): Order<A> {
284
284
  * returned; otherwise, the second order is applied. The result is the first
285
285
  * non-zero comparison result, or `0` if both orders return `0`.
286
286
  *
287
- * **Example** (Combining Orders)
287
+ * **Example** (Combining two Orders)
288
288
  *
289
289
  * ```ts
290
290
  * import { Order } from "effect"
@@ -327,7 +327,7 @@ export const combine: {
327
327
  * returned; otherwise, the second order is applied. The result is the first
328
328
  * non-zero comparison result, or `0` if both orders return `0`.
329
329
  *
330
- * **Example** (Combining Orders)
330
+ * **Example** (Combining two Orders)
331
331
  *
332
332
  * ```ts
333
333
  * import { Order } from "effect"
@@ -370,7 +370,7 @@ export const combine: {
370
370
  * returned; otherwise, the second order is applied. The result is the first
371
371
  * non-zero comparison result, or `0` if both orders return `0`.
372
372
  *
373
- * **Example** (Combining Orders)
373
+ * **Example** (Combining two Orders)
374
374
  *
375
375
  * ```ts
376
376
  * import { Order } from "effect"
@@ -420,7 +420,7 @@ export const combine: {
420
420
  * Always returns `0` regardless of input values, making it useful as a neutral
421
421
  * element in order composition.
422
422
  *
423
- * **Example** (Always Equal Order)
423
+ * **Example** (Ordering with an always-equal Order)
424
424
  *
425
425
  * ```ts
426
426
  * import { Order } from "effect"
@@ -453,7 +453,7 @@ export function alwaysEqual<A>(): Order<A> {
453
453
  * Applies orders in iteration order and short-circuits on the first non-zero
454
454
  * result. It returns `0` only if all orders return `0`.
455
455
  *
456
- * **Example** (Combining Multiple Orders)
456
+ * **Example** (Combining multiple Orders)
457
457
  *
458
458
  * ```ts
459
459
  * import { Order } from "effect"
@@ -610,7 +610,7 @@ export const mapInput: {
610
610
  * Earlier dates are less than later dates. Invalid dates are compared through
611
611
  * their `getTime()` result.
612
612
  *
613
- * **Example** (Date Ordering)
613
+ * **Example** (Ordering Dates)
614
614
  *
615
615
  * ```ts
616
616
  * import { Order } from "effect"
@@ -642,7 +642,7 @@ export const Date: Order<Date> = mapInput(Number, (date) => date.getTime())
642
642
  * the first non-zero comparison result. Tuples must have the same length as the
643
643
  * order collection, and the result is `0` only if all elements are equal.
644
644
  *
645
- * **Example** (Tuple Ordering)
645
+ * **Example** (Ordering tuples)
646
646
  *
647
647
  * ```ts
648
648
  * import { Order } from "effect"
@@ -706,7 +706,7 @@ export {
706
706
  * are less than longer arrays. The result is `0` only if arrays have the same
707
707
  * length and all elements are equal.
708
708
  *
709
- * **Example** (Array Element Ordering)
709
+ * **Example** (Ordering array elements)
710
710
  *
711
711
  * ```ts
712
712
  * import { Order } from "effect"
@@ -739,7 +739,7 @@ export {
739
739
  * stops at the first non-zero comparison result. Field order matters: earlier
740
740
  * fields take precedence. The result is `0` only if all fields are equal.
741
741
  *
742
- * **Example** (Struct Ordering)
742
+ * **Example** (Ordering structs)
743
743
  *
744
744
  * ```ts
745
745
  * import { Order } from "effect"
@@ -790,7 +790,7 @@ export function Struct<const R extends { readonly [x: string]: Order<any> }>(
790
790
  * Returns `true` if the order returns `-1`, meaning the first value is less
791
791
  * than the second. Equal or greater values return `false`.
792
792
  *
793
- * **Example** (Less Than)
793
+ * **Example** (Checking less-than comparisons)
794
794
  *
795
795
  * ```ts
796
796
  * import { Order } from "effect"
@@ -824,7 +824,7 @@ export const isLessThan = <A>(O: Order<A>): {
824
824
  * Returns `true` if the order returns `1`, meaning the first value is greater
825
825
  * than the second. Equal or lesser values return `false`.
826
826
  *
827
- * **Example** (Greater Than)
827
+ * **Example** (Checking greater-than comparisons)
828
828
  *
829
829
  * ```ts
830
830
  * import { Order } from "effect"
@@ -858,7 +858,7 @@ export const isGreaterThan = <A>(O: Order<A>): {
858
858
  * Returns `true` if the order returns `-1` or `0`, and returns `false` only if
859
859
  * the order returns `1`.
860
860
  *
861
- * **Example** (Less Than Or Equal)
861
+ * **Example** (Checking less-than-or-equal comparisons)
862
862
  *
863
863
  * ```ts
864
864
  * import { Order } from "effect"
@@ -893,7 +893,7 @@ export const isLessThanOrEqualTo = <A>(O: Order<A>): {
893
893
  * Returns `true` if the order returns `1` or `0`, and returns `false` only if
894
894
  * the order returns `-1`.
895
895
  *
896
- * **Example** (Greater Than Or Equal)
896
+ * **Example** (Checking greater-than-or-equal comparisons)
897
897
  *
898
898
  * ```ts
899
899
  * import { Order } from "effect"
@@ -928,7 +928,7 @@ export const isGreaterThanOrEqualTo = <A>(O: Order<A>): {
928
928
  * Returns the value that compares as less than or equal to the other value. If
929
929
  * values are equal, the first argument is returned.
930
930
  *
931
- * **Example** (Minimum Value)
931
+ * **Example** (Selecting the minimum value)
932
932
  *
933
933
  * ```ts
934
934
  * import { Order } from "effect"
@@ -963,7 +963,7 @@ export const min = <A>(O: Order<A>): {
963
963
  * Returns the value that compares as greater than or equal to the other value.
964
964
  * If values are equal, the first argument is returned.
965
965
  *
966
- * **Example** (Maximum Value)
966
+ * **Example** (Selecting the maximum value)
967
967
  *
968
968
  * ```ts
969
969
  * import { Order } from "effect"
@@ -1000,7 +1000,7 @@ export const max = <A>(O: Order<A>): {
1000
1000
  * maximum. The minimum must be less than or equal to the maximum according to
1001
1001
  * the order.
1002
1002
  *
1003
- * **Example** (Clamping Values)
1003
+ * **Example** (Clamping values)
1004
1004
  *
1005
1005
  * ```ts
1006
1006
  * import { Order } from "effect"
@@ -1051,7 +1051,7 @@ export const clamp = <A>(O: Order<A>): {
1051
1051
  * than or equal to maximum. Values outside the range return `false`. Both
1052
1052
  * bounds are inclusive.
1053
1053
  *
1054
- * **Example** (Checking Range)
1054
+ * **Example** (Checking ranges)
1055
1055
  *
1056
1056
  * ```ts
1057
1057
  * import { Order } from "effect"
package/src/Pool.ts CHANGED
@@ -248,7 +248,7 @@ export const make = <A, E, R>(options: {
248
248
  * from item creation, while `"usage"` measures from pool usage. The default is
249
249
  * `"usage"`.
250
250
  *
251
- * **Example** (Create a connection pool)
251
+ * **Example** (Creating a connection pool)
252
252
  *
253
253
  * ```ts
254
254
  * import { Duration, Effect, Pool } from "effect"